zhengnaiwen_citu 7 hónapja
szülő
commit
95f1fa5508

+ 1 - 1
.env.production

@@ -4,6 +4,6 @@ NODE_ENV = 'production'
 VUE_APP_MODE = 'production'
 # base api
 
-# VUE_APP_BASE_API = 'http://115.128.14.14/op/base'
+VUE_APP_BASE_API = '/op/base'
 
 

+ 5 - 81
src/api/system.js

@@ -1,41 +1,5 @@
 import http from '@/utils/request'
 
-/**
- * 列表前端配置表
- * @param { Object } data
- * @param data.entity.webSettingCategory
- * 配置类型
- * 默认 tableTitle => 默认字段 暂未使用
- *      chartClass => 自动图表->图表分类
- *      chartList => 自动图表类型
- *      chartLibrary => 图表库
- *      tableManage => 表头管理
- * @returns
- */
-export function getSettingList (data) {
-  return http.post('/authentication/web/setting/list', data)
-}
-
-// 列表前端配置表 保存
-export function saveSettingList (data) {
-  return http.post('/authentication/web/setting/save', data)
-}
-
-// 列表前端配置表 删除
-export function deleteSettingList (data) {
-  return http.post('/authentication/web/setting/del', data)
-}
-
-// 修改个性化配置
-export function updateSystemSetting (data) {
-  return http.post('/authentication/companyInfo/setting/update', data)
-}
-
-// 查询租户配置
-export function getSettingInfo (data) {
-  return http.post('/authentication/companyInfo/tenantcode', data)
-}
-
 // 业务应用程序更新===============================================
 // 上传更新包
 export function uploadVersionPackage (params) {
@@ -152,65 +116,25 @@ export function refreshToken () {
 
 // 获取树状机构
 export function getOrganizationTree () {
-  return http.post('/digitizationData/organization/tree')
-}
-
-// 导入树状机构
-export function uploadOrganizationTree () {
-  return http.upload('/digitizationData/organization/upload')
-}
-
-// 导出树状机构
-export function exportOrganizationTree () {
-  return http.download('/digitizationData/organization/export')
-}
-
-// 导出树状机构模板
-export function exportOrganizationTreeTemplate () {
-  return http.download('/digitizationData/organization/download/tmp')
-}
-
-// 保存机构树
-export function saveOrganizationTree (params) {
-  return http.post('/digitizationData/organization/save', params)
-}
-
-// 删除树状机构
-export function deleteOrganization (params) {
-  return http.post('/digitizationData/organization/del', params)
-}
-
-// 设置埋点
-export function setBurialPoint (params) {
-  return http.post('/authentication/access/record/log/save', params)
-}
-
-// 获取统计信息
-export function getBurialPointStatistics () {
-  return http.get('/authentication/access/record/log/home/statistics')
+  return http.post('/digitizationData/employee/organization/tree')
 }
 
 // 花名册列表
 export function getRosterList (params) {
-  return http.post('/digitizationData/t/raw/employee/list/list', params)
-}
-
-// 花名册详情
-export function getRosterDetails (params) {
-  return http.post('/digitizationData/t/raw/employee/list/detail', params)
+  return http.post('/digitizationData/employee/list', params)
 }
 
 // 花名册保存
 export function saveRoster (params) {
-  return http.post('/digitizationData/t/raw/employee/list/save', params)
+  return http.post('/digitizationData/employee/save', params)
 }
 
 // 花名册删除
 export function deleteRoster (params) {
-  return http.post('/digitizationData/t/raw/employee/list/del', params)
+  return http.post('/digitizationData/employee/del', params)
 }
 
 // 花名册上传
 export function uploadRoster (params) {
-  return http.upload('/digitizationData/t/raw/employee/list/upload', params)
+  return http.upload('/digitizationData/employee/upload', params)
 }

+ 5 - 2
src/components/AutoComponents/MForm/index.vue

@@ -8,10 +8,10 @@
     v-bind="$attrs"
     v-on="$listeners"
   >
-    <template v-for="item in items">
+    <template v-for="(item, _i) in items">
       <el-form-item
         v-if="!item.hidden"
-        :key="item.prop"
+        :key="item.prop || _i"
         v-bind="item"
       >
         <template v-if="!item.type">
@@ -80,6 +80,9 @@
             </template>
           </el-radio-group>
         </template>
+        <template v-if="item.type === 'datePicker'">
+          <el-date-picker v-bind="item.options" v-on="item.handles" v-model="query[item.prop]"></el-date-picker>
+        </template>
       </el-form-item>
     </template>
     <slot></slot>

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

@@ -44,7 +44,7 @@
 
         <!-- 其他类型可以根据需要扩展 -->
       </el-form-item>
-      <el-form-item>
+      <el-form-item class="flex">
         <template v-if="items.length">
           <m-button class="ml-3" icon="el-icon-search" @click="onSubmit">查询</m-button>
           <m-button class="ml-3" icon="el-icon-refresh" @click="onReset">重置</m-button>
@@ -103,4 +103,7 @@ export default {
 ::v-deep .el-form-item {
   margin: 0 !important;
 }
+.flex ::v-deep .el-form-item__content{
+  display: flex;
+}
 </style>

+ 55 - 0
src/views/system/organizationStructure/index.vue

@@ -0,0 +1,55 @@
+<template>
+  <m-table
+    v-loading="loading"
+    row-key="uuid"
+    :items="items"
+    :headers="headers"
+    :page-size="total"
+    :page-current="1"
+    :total="total"
+    :expand-row-keys="expandRowKeys"
+    :tree-props="{children: 'child'}"
+    :default-sort="{ prop: 'sort', order: 'ascending' }"
+  ></m-table>
+</template>
+
+<script>
+import {
+  getOrganizationTree
+} from '@/api/system'
+export default {
+  name: 'organization-structure',
+  data () {
+    return {
+      expandRowKeys: [],
+      loading: false,
+      items: [],
+      total: 0,
+      headers: [
+        { label: '机构名称', prop: 'organizationName' }
+      ]
+    }
+  },
+  created () {
+    this.init()
+  },
+  methods: {
+    async init () {
+      try {
+        const { data } = await getOrganizationTree()
+        this.expandRowKeys = [data.uuid]
+        this.items = [
+          data
+        ]
+        this.total = this.items.length
+      } catch (error) {
+        this.$message.error(error)
+      }
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 160 - 0
src/views/system/roster/index.vue

@@ -0,0 +1,160 @@
+<template>
+  <div>
+    <m-search :items="searchItems" v-model="searchValues" class="mb-3" @search="onSearch" @reset="onSearch">
+      <template #button>
+        <m-button type="primary" icon="el-icon-plus" @click="onAdd">新增</m-button>
+        <el-upload class="el-button pa-0">
+          <m-button type="primary" icon="el-icon-upload2" @click="onAdd">上传</m-button>
+        </el-upload>
+        <m-button type="primary" icon="el-icon-download" @click="onAdd">导出</m-button>
+      </template>
+    </m-search>
+    <m-table
+      v-loading="loading"
+      row-key="id"
+      :items="items"
+      :headers="headers"
+      :page-size="pageInfo.size"
+      :page-current="pageInfo.current"
+      :total="total"
+      :default-sort="{ prop: 'sort', order: 'ascending' }"
+      @page-change="pageChange"
+    >
+      <template #actions="{ row }">
+        <m-button text type="primary" @click="onEdit(row)">编辑</m-button>
+        <m-button text type="danger" @click="onDelete(row)">删除</m-button>
+      </template>
+    </m-table>
+    <rosterEdit ref="rosterEditRef" :title="title" @refresh="init"></rosterEdit>
+  </div>
+</template>
+
+<script>
+import rosterEdit from './rosterEdit.vue'
+import {
+  getRosterList,
+  deleteRoster
+} from '@/api/system'
+export default {
+  name: 'sys-roster',
+  components: { rosterEdit },
+  data () {
+    return {
+      title: '',
+      searchItems: [
+        {
+          label: '员工名称',
+          option: {
+            placeholder: '请输入员工名称'
+          },
+          prop: 'employeeName',
+          type: 'input'
+        },
+        {
+          label: '机构名称',
+          option: {
+            placeholder: '请输入机构名称'
+          },
+          prop: 'organizationName',
+          type: 'input'
+        }
+      ],
+      loading: false,
+      searchValues: {
+        employeeName: null
+      },
+      headers: [
+        // { text: '一级机构', align: 'start', value: 'secondLevelBranch' },
+        { label: '上级机构', prop: 'parentOrganizationName' },
+        { label: '部门', prop: 'deptName' },
+        { label: '员工名称', prop: 'employeeName' },
+        { label: '人员类别', prop: 'personnelCategory' },
+        { label: '岗位名称', prop: 'postName' },
+        { label: '岗位序列', prop: 'positionSequence' },
+        { label: '岗位类别', prop: 'positionCategory' },
+        { label: '职务层级', prop: 'jobLevel' },
+        { label: '通行证号', prop: 'passes' },
+        { label: '工行时间', prop: 'tradeUnionsTime' },
+        { label: '薪酬档次', align: 'center', prop: 'salaryCategory' },
+        { label: '薪酬级别', align: 'center', prop: 'salaryLevel' },
+        { label: '操作', prop: 'actions' }
+      ],
+      itemData: {},
+      items: [],
+      orders: [],
+      pageInfo: {
+        size: 10,
+        current: 1
+      },
+      total: 0
+    }
+  },
+  created () {
+    this.init()
+  },
+  methods: {
+    async init () {
+      this.loading = true
+      try {
+        const { data } = await getRosterList({
+          page: { ...this.pageInfo, orders: this.orders },
+          entity: {
+            ...this.searchValues
+          }
+        })
+        this.items = data.records.map(e => {
+          const { tradeUnionsTime, ...obj } = e
+          const date = new Date(tradeUnionsTime)
+          // 获取年、月、日
+          const year = date.getFullYear()
+          const month = String(date.getMonth() + 1).padStart(2, '0') // 月份从0开始,所以要加1
+          const day = String(date.getDate()).padStart(2, '0')
+          return {
+            ...obj,
+            tradeUnionsTime: `${year}${month}${day}`
+          }
+        })
+        this.total = data.total
+      } catch (error) {
+        this.$message.error(error)
+      } finally {
+        this.loading = false
+      }
+    },
+    onSearch () {
+      this.pageInfo.current = 1
+      this.init()
+    },
+    onAdd () {
+      this.title = '新增员工'
+      this.$refs.rosterEditRef.open()
+    },
+    onEdit (item) {
+      this.title = '编辑员工'
+      this.$refs.rosterEditRef.open(item)
+    },
+    onDelete (item) {
+      this.$confirm('确定删除该员工吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        try {
+          await deleteRoster({ deleteRoster: item.deleteRoster })
+          this.$message.success('删除成功')
+        } catch (error) {
+          this.$message.error(error)
+        }
+      }).catch(() => {})
+    },
+    pageChange (index) {
+      this.pageInfo.current = index
+      this.init()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 87 - 0
src/views/system/roster/rosterEdit.vue

@@ -0,0 +1,87 @@
+<template>
+  <m-dialog ref="editDialog" v-bind="$attrs" @sure="handleSaveEdit">
+    <m-form ref="formRef" :items="items" v-model="query"></m-form>
+  </m-dialog>
+</template>
+
+<script>
+import { saveRoster } from '@/api/system'
+export default {
+  name: 'roster-edit',
+  data () {
+    return {
+      items: [
+        { label: '上级机构', prop: 'parentOrganizationName', type: 'input', options: { placeholder: '请输入上级机构' }, rules: { required: true, message: '请输入上级机构', trigger: 'blur' } },
+        { label: '部门名称', prop: 'deptName', type: 'input', options: { placeholder: '请输入部门名称' }, rules: { required: true, message: '请输入部门名称', trigger: 'blur' } },
+        { label: '员工名称', prop: 'employeeName', type: 'input', options: { placeholder: '请输入员工名称' }, rules: { required: true, message: '请输入员工名称', trigger: 'blur' } },
+        { label: '人员类别', prop: 'personnelCategory', type: 'input', options: { placeholder: '请输入人员类别' }, rules: { required: true, message: '请输入人员类别', trigger: 'blur' } },
+        { label: '岗位名称', prop: 'postName', type: 'input', options: { placeholder: '请输入岗位名称' }, rules: { required: true, message: '请输入岗位名称', trigger: 'blur' } },
+        { label: '岗位序列', prop: 'positionSequence', type: 'input', options: { placeholder: '请输入岗位序列' }, rules: [{ required: true, message: '请输入岗位序列', trigger: 'blur' }] },
+        { label: '岗位类别', prop: 'positionCategory', type: 'input', options: { placeholder: '请输入岗位类别' }, rules: [{ required: true, message: '请输入岗位类别', trigger: 'blur' }] },
+        { label: '职务层级', prop: 'jobLevel', type: 'input', options: { placeholder: '请输入职务层级' }, rules: [{ required: true, message: '请输入职务层级', trigger: 'blur' }] },
+        { label: '通行证号', prop: 'passes', type: 'input', options: { placeholder: '请输入通行证号' }, rules: [{ required: true, message: '请输入通行证号', trigger: 'blur' }] },
+        {
+          label: '工行时间',
+          prop: 'tradeUnionsTime',
+          type: 'datePicker',
+          options: { placeholder: '请选择工行时间' },
+          rules: [{ required: true, message: '请选择工行时间', trigger: 'blur' }]
+        },
+        { label: '薪酬档次', prop: 'salaryCategory', type: 'number', options: { placeholder: '薪酬档次' }, rules: [{ required: true, message: '请输入薪酬档次', trigger: 'blur' }] },
+        { label: '薪酬级别', prop: 'salaryLevel', type: 'number', options: { placeholder: '薪酬级别' }, rules: [{ required: true, message: '请输入薪酬级别', trigger: 'blur' }] }
+      ],
+      query: {}
+    }
+  },
+  created () {
+    this.init()
+  },
+  methods: {
+    init () {
+      this.query = this.items.reduce((res, item) => {
+        res[item.prop] = null
+        return res
+      }, {})
+    },
+    open (item) {
+      if (item) {
+        Object.keys(this.query).forEach(key => {
+          this.query[key] = item[key]
+        })
+        this.query.personnelCode = item.personnelCode
+      } else {
+        this.init()
+      }
+      this.$refs.editDialog.open()
+    },
+    handleSaveEdit () {
+      this.$refs.formRef.validate(async valid => {
+        if (!valid) {
+          return
+        }
+        const { tradeUnionsTime, ...obj } = this.query
+        const date = new Date(tradeUnionsTime)
+        // 获取年、月、日
+        const year = date.getFullYear()
+        const month = String(date.getMonth() + 1).padStart(2, '0') // 月份从0开始,所以要加1
+        const day = String(date.getDate()).padStart(2, '0')
+        try {
+          await saveRoster({
+            ...obj,
+            tradeUnionsTime: `${year}${month}${day}`
+          })
+          this.$message.success('保存成功')
+          this.$refs.editDialog.close()
+          this.$emit('refresh')
+        } catch (error) {
+          this.$message.error(error)
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>