Xiao_123 vor 4 Monaten
Ursprung
Commit
ceb7dd989f

+ 5 - 0
src/api/salary.js

@@ -160,3 +160,8 @@ export function getSalaryFixedStatistics (data) {
 export function getSalaryFixedEmployeeStatistics (data) {
   return http.post('/employee/basic/salary/month/trend', data)
 }
+
+// 客户分润认领
+export function getCustomerProfitSharingClaim (data) {
+  return http.post('/customer/performance/page', data)
+}

+ 153 - 0
src/views/salary/claim/components/form.vue

@@ -0,0 +1,153 @@
+<template>
+  <m-dialog title="分润认领" ref="dialog" @sure="onSure">
+    <m-form ref="form" :items="formItems" v-model="formValues" v-loading="loading"></m-form>
+  </m-dialog>
+</template>
+
+<script>
+import { mapGetters } from 'vuex'
+export default {
+  name: 'ClaimForm',
+  data () {
+    return {
+      formValues: {
+        serialNumber: null,
+        unifiedCertificationNumber: null,
+        organizationNo: null,
+        employeeProfitSharingRatio: null
+      },
+      itemData: {},
+      filterLoading: false,
+      loading: false,
+      items: []
+    }
+  },
+  computed: {
+    ...mapGetters(['organizationTree']),
+    organizationItems () {
+      if (this.organizationTree.length > 0) {
+        return this.organizationTree[0].child
+      }
+      return []
+    },
+    formItems () {
+      return [
+        {
+          label: '所属机构',
+          prop: 'organizationNo',
+          type: 'cascader',
+          rules: [
+            { required: true, message: '请选择所属机构', trigger: 'change' }
+          ],
+          options: {
+            ref: 'organizationNo',
+            filterable: true,
+            clearable: true,
+            placeholder: '请选择所属机构',
+            options: this.organizationItems,
+            showAllLevels: false,
+            props: {
+              emitPath: false,
+              checkStrictly: true,
+              value: 'organizationNo',
+              label: 'organizationName',
+              children: 'child'
+            }
+          },
+          handles: {
+            change: (v) => {
+              const nodes = this.$refs.form.$refs.organizationNo.getCheckedNodes()
+              console.log(nodes[0].data.organizationNo, '选中机构编码')
+              // this.formValues.organizationNo = nodes[0].data.organizationNo
+              // this.formValues.organizationName = nodes[0].data.organizationName
+            }
+          }
+        },
+        {
+          label: '分润员工',
+          prop: 'unifiedCertificationNumber',
+          type: 'select',
+          options: {
+            placeholder: '请选择分润员工',
+            filterable: true,
+            remote: true,
+            labelText: 'employeeName',
+            labelValue: 'personnelCode',
+            valueKey: 'personnelCode',
+            defaultFirstOption: true,
+            loading: this.filterLoading,
+            items: []
+          },
+          // handles: {
+          //   change: (v) => {
+          //     const item = this.items.find(e => e.personnelCode === v)
+          //     this.formValues.employeeName = item.employeeName
+          //     this.formValues.employeeCode = item.personnelCode
+          //   }
+          // },
+          rules: [
+            { required: true, message: '请选择分润员工', trigger: 'change' }
+          ]
+        }
+        // employeeProfitSharingRatio
+      ]
+    }
+  },
+  methods: {
+    async open (item) {
+      console.log(item, '分润认领')
+      this.loading = true
+      this.$refs.dialog.open()
+      // if (!item) {
+      //   this.itemData = {}
+      //   this.formValues = {
+      //     employeeCode: null,
+      //     employeeName: null,
+      //     organizationNo: null,
+      //     organizationName: null
+      //   }
+      // } else {
+      //   await this.remoteMethod(item.employeeName)
+      //   this.itemData = item
+      //   this.formValues = {
+      //     employeeCode: item.employeeCode,
+      //     organizationName: item.organizationName,
+      //     organizationNo: item.organizationNo,
+      //     employeeName: item.employeeName
+      //   }
+      // }
+      this.formValues.serialNumber = item.serialNumber
+      this.$nextTick(() => {
+        this.$refs.form.clearValidate()
+        this.loading = false
+      })
+    },
+    onSure () {
+      this.$refs.form.validate(async valid => {
+        if (!valid) {
+          return
+        }
+        console.log(this.formValues, 'submit')
+        // this.loading = true
+        // try {
+        //   await saveAllocationConfig({
+        //     performanceSalaryManageEmployeeId: this.itemData.performanceSalaryManageEmployeeId,
+        //     ...this.formValues
+        //   })
+        //   this.$refs.dialog.close()
+        //   this.$message.success('操作成功')
+        //   this.$emit('success')
+        // } catch (error) {
+        //   this.$message.error(error)
+        // } finally {
+        //   this.loading = false
+        // }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 130 - 0
src/views/salary/claim/components/table.vue

@@ -0,0 +1,130 @@
+<template>
+  <div>
+    <m-search class="mb-3" :items="searchItems" v-model="searchValues" @search="onSearch"></m-search>
+    <m-table
+      v-loading="loading"
+      :items="items"
+      :headers="headers"
+      :page-size="pageInfo.size"
+      :page-current="pageInfo.current"
+      :total="total"
+      @page-change="onPageChange"
+    >
+      <!-- <template #card-tools>
+        <m-button type="orange" icon="el-icon-plus" @click="onAdd">新增</m-button>
+      </template> -->
+      <template #actions="{ row }">
+        <m-button type="primary" text @click="onEdit(row)">分润认领</m-button>
+        <!-- <m-button type="danger" text @click="onDelete(row)">删除</m-button> -->
+      </template>
+    </m-table>
+  </div>
+</template>
+
+<script>
+import { getCustomerProfitSharingClaim } from '@/api/salary'
+export default {
+  name: 'salaryClaimCommonTable',
+  props: {
+    type: {
+      type: String,
+      default: '0'
+    }
+  },
+  data () {
+    return {
+      searchItems: [
+        {
+          label: '客户编号',
+          prop: 'customerId',
+          type: 'input',
+          options: {
+            placeholder: '请输入客户编号'
+          }
+        },
+        {
+          label: '科目名称',
+          prop: 'subjectName',
+          type: 'input',
+          options: {
+            placeholder: '请输入科目名称'
+          }
+        }
+      ],
+      searchValues: {
+        subjectName: null,
+        customerId: null
+      },
+      headers: [
+        { label: '客户编号', prop: 'customerId' },
+        { label: '一级科目编码/名称', prop: 'oneLevelSubject' },
+        { label: '二级科目编码/名称', prop: 'twoLevelSubject' },
+        { label: '金额', prop: 'amount' },
+        { label: '统一认证号1', prop: 'unifiedCertificationNumber1' },
+        { label: '统一认证号2', prop: 'unifiedCertificationNumber2' },
+        { label: '数据日期', prop: 'dataDate' },
+        { label: '管户层级标识', prop: 'customerLevelIdentifier' },
+        { label: '客户类别标识', prop: 'customerCategoryIdentifier' },
+        { label: '员工分润比例', prop: 'employeeProfitSharingRatio' },
+        { label: '操作', prop: 'actions', fixed: 'right' }
+      ],
+      items: [],
+      total: 0,
+      pageInfo: {
+        current: 1,
+        size: 10
+      },
+      loading: false
+    }
+  },
+  methods: {
+    async onInit () {
+      this.loading = true
+      try {
+        const { data } = await getCustomerProfitSharingClaim({
+          ...this.pageInfo,
+          level: this.type,
+          ...this.searchValues
+        })
+        this.items = data.records
+        this.total = data.total
+      } catch (error) {
+        this.$message.error(error)
+      } finally {
+        this.loading = false
+      }
+    },
+    onAdd () {
+      this.$refs.templateRefs.open()
+    },
+    onEdit (item) {
+      this.$refs.templateRefs.open(item)
+    },
+    onDelete (row) {
+      this.$confirm('确定删除吗?', '提示')
+        .then(async () => {
+          try {
+            // await ApiName({ id: row.id })
+            this.$message.success('删除成功')
+            this.onInit()
+          } catch (error) {
+            this.$message.error(error)
+          }
+        })
+        .catch(_ => {})
+    },
+    onSearch () {
+      this.pageInfo.current = 1
+      this.onInit()
+    },
+    onPageChange (index) {
+      this.pageInfo.current = index
+      this.onInit()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+  /* 自定义样式 */
+</style>

+ 29 - 0
src/views/salary/claim/corporateFinance/index.vue

@@ -0,0 +1,29 @@
+<template>
+  <div>
+    <table-page ref="tableRef" type="4" />
+  </div>
+</template>
+
+<script>
+// 公司金融业务部业绩分润
+import TablePage from '../components/table.vue'
+export default {
+  name: 'salaryClaimCorporateFinance',
+  components: {
+    TablePage
+  },
+  data () {
+    return {
+    }
+  },
+  methods: {
+    onInit () {
+      this.$refs.tableRef.onInit()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+  /* 自定义样式 */
+</style>

+ 65 - 0
src/views/salary/claim/index copy.vue

@@ -0,0 +1,65 @@
+<template>
+  <div class="pa-3 white">
+    <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" :label="item.label" @hook:mounted="onComponentMounted"></component>
+      </el-tab-pane>
+    </el-tabs>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'SalaryClaimIndex',
+  data () {
+    return {
+      activeName: '',
+      items: []
+    }
+  },
+  created () {
+    this.items = this.$route.meta.roles.filter(e => e.hidden === 1).sort((a, b) => a.sort - b.sort).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
+    }
+  },
+  computed: {
+    name () {
+      return this.items.find(e => e.name === this.activeName)?.label ?? ''
+    }
+  },
+  methods: {
+    onComponentMounted () {
+      this.$nextTick(() => {
+        if (!this.$refs[this.activeName]) {
+          return
+        }
+        this.$refs[this.activeName][0].onInit && this.$refs[this.activeName][0].onInit(this.name)
+      })
+    },
+    handleClick () {
+      this.$router.push(`${this.$route.path}?name=${this.activeName}`)
+      this.$nextTick(() => {
+        this.$refs[this.activeName][0].onInit && this.$refs[this.activeName][0].onInit(this.name)
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+  /* 自定义样式 */
+</style>

+ 42 - 82
src/views/salary/claim/index.vue

@@ -1,100 +1,60 @@
 <template>
   <div class="pa-3 white">
-    <m-search class="mb-3" :items="searchItems" v-model="searchValues" @search="onSearch"></m-search>
-    <m-table
-      v-loading="loading"
-      :items="items"
-      :headers="headers"
-      :page-size="pageInfo.size"
-      :page-current="pageInfo.current"
-      :total="total"
-      @page-change="onPageChange"
-    >
-      <template #card-tools>
-        <m-button type="orange" icon="el-icon-plus" @click="onAdd">新增</m-button>
-      </template>
-      <template #actions="{ row }">
-        <m-button type="primary" text @click="onEdit(row)">编辑</m-button>
-        <m-button type="danger" text @click="onDelete(row)">删除</m-button>
-      </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" :label="item.label" @hook:mounted="onComponentMounted"></component>
+      </el-tab-pane>
+    </el-tabs>
   </div>
 </template>
 
 <script>
 export default {
-  name: 'template',
+  name: 'SalaryClaimIndex',
   data () {
     return {
-      searchItems: [
-        {
-          label: '名称',
-          prop: 'name',
-          type: 'input',
-          options: {
-            placeholder: '请输入名称'
-          }
-        }
-      ],
-      searchValues: {
-        name: null
-      },
-      headers: [
-        { label: '名称', prop: 'name' },
-        { label: '状态', prop: 'status' },
-        { label: '操作', prop: 'actions', fixed: 'right', width: 300 }
-      ],
-      items: [],
-      total: 0,
-      pageInfo: {
-        current: 1,
-        size: 10
-      },
-      loading: false
+      activeName: '',
+      items: []
     }
   },
   created () {
-    this.onInit()
+    this.items = this.$route.meta.roles.filter(e => e.hidden === 1).sort((a, b) => a.sort - b.sort).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
+    }
+  },
+  computed: {
+    name () {
+      return this.items.find(e => e.name === this.activeName)?.label ?? ''
+    }
   },
   methods: {
-    async onInit () {
-      this.loading = true
-      try {
-        // const { data } = await ApiName()
-        // this.items = data.records
-        // this.total = data.total
-      } catch (error) {
-        this.$message.error(error)
-      } finally {
-        this.loading = false
-      }
-    },
-    onAdd () {
-      this.$refs.templateRefs.open()
-    },
-    onEdit (item) {
-      this.$refs.templateRefs.open(item)
-    },
-    onDelete (row) {
-      this.$confirm('确定删除吗?', '提示')
-        .then(async () => {
-          try {
-            // await ApiName({ id: row.id })
-            this.$message.success('删除成功')
-            this.onInit()
-          } catch (error) {
-            this.$message.error(error)
-          }
-        })
-        .catch(_ => {})
-    },
-    onSearch () {
-      this.pageInfo.current = 1
-      this.onInit()
+    onComponentMounted () {
+      this.$nextTick(() => {
+        if (!this.$refs[this.activeName]) {
+          return
+        }
+        this.$refs[this.activeName][0].onInit && this.$refs[this.activeName][0].onInit(this.name)
+      })
     },
-    onPageChange (index) {
-      this.pageInfo.current = index
-      this.onInit()
+    handleClick () {
+      this.$router.push(`${this.$route.path}?name=${this.activeName}`)
+      this.$nextTick(() => {
+        this.$refs[this.activeName][0].onInit && this.$refs[this.activeName][0].onInit(this.name)
+      })
     }
   }
 }

+ 29 - 0
src/views/salary/claim/institutionalBanking/index.vue

@@ -0,0 +1,29 @@
+<template>
+  <div>
+    <table-page ref="tableRef" type="5" />
+  </div>
+</template>
+
+<script>
+// 机构金融业务部业绩分润
+import TablePage from '../components/table.vue'
+export default {
+  name: 'salaryClaimInstitutionalBanking',
+  components: {
+    TablePage
+  },
+  data () {
+    return {
+    }
+  },
+  methods: {
+    onInit () {
+      this.$refs.tableRef.onInit()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+  /* 自定义样式 */
+</style>

+ 28 - 0
src/views/salary/claim/network/index.vue

@@ -0,0 +1,28 @@
+<template>
+  <div>
+    <table-page ref="tableRef" type="1" />
+  </div>
+</template>
+
+<script>
+// 网点业绩分润
+import TablePage from '../components/table.vue'
+export default {
+  name: 'salaryClaimNetwork',
+  components: {
+    TablePage
+  },
+  data () {
+    return {}
+  },
+  methods: {
+    onInit () {
+      this.$refs.tableRef.onInit()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+  /* 自定义样式 */
+</style>

+ 29 - 0
src/views/salary/claim/personalFinance/index.vue

@@ -0,0 +1,29 @@
+<template>
+  <div>
+    <table-page ref="tableRef" type="2" />
+  </div>
+</template>
+
+<script>
+// 个人金融业务部业绩分润
+import TablePage from '../components/table.vue'
+export default {
+  name: 'salaryClaimPersonalFinance',
+  components: {
+    TablePage
+  },
+  data () {
+    return {
+    }
+  },
+  methods: {
+    onInit () {
+      this.$refs.tableRef.onInit()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+  /* 自定义样式 */
+</style>

+ 29 - 0
src/views/salary/claim/personalLoans/index.vue

@@ -0,0 +1,29 @@
+<template>
+  <div>
+    <table-page ref="tableRef" type="3" />
+  </div>
+</template>
+
+<script>
+// 个人贷款业务部业绩分润
+import TablePage from '../components/table.vue'
+export default {
+  name: 'salaryClaimPersonalLoans',
+  components: {
+    TablePage
+  },
+  data () {
+    return {
+    }
+  },
+  methods: {
+    onInit () {
+      this.$refs.tableRef.onInit()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+  /* 自定义样式 */
+</style>

+ 112 - 0
src/views/salary/claim/sharingClaim/index.vue

@@ -0,0 +1,112 @@
+<template>
+  <div>
+    <m-search class="mb-3" :items="searchItems" v-model="searchValues" @search="onSearch"></m-search>
+    <m-table
+      v-loading="loading"
+      :items="items"
+      :headers="headers"
+      :page-size="pageInfo.size"
+      :page-current="pageInfo.current"
+      :total="total"
+      @page-change="onPageChange"
+    >
+      <template #actions="{ row }">
+        <m-button type="primary" text @click="onClaim(row)">分润认领</m-button>
+      </template>
+    </m-table>
+
+    <ClaimForm ref="claimFormRef" @success="onInit" />
+  </div>
+</template>
+
+<script>
+import { getCustomerProfitSharingClaim } from '@/api/salary'
+import ClaimForm from '../components/form.vue'
+export default {
+  name: 'salaryClaimSharing',
+  components: {
+    ClaimForm
+  },
+  data () {
+    return {
+      searchItems: [
+        {
+          label: '客户编号',
+          prop: 'customerId',
+          type: 'input',
+          options: {
+            placeholder: '请输入客户编号'
+          }
+        },
+        {
+          label: '科目名称',
+          prop: 'subjectName',
+          type: 'input',
+          options: {
+            placeholder: '请输入科目名称'
+          }
+        }
+      ],
+      searchValues: {
+        subjectName: null,
+        customerId: null
+      },
+      headers: [
+        { label: '客户编号', prop: 'customerId' },
+        { label: '一级科目编码/名称', prop: 'oneLevelSubject' },
+        { label: '二级科目编码/名称', prop: 'twoLevelSubject' },
+        { label: '金额', prop: 'amount' },
+        { label: '统一认证号1', prop: 'unifiedCertificationNumber1' },
+        { label: '统一认证号2', prop: 'unifiedCertificationNumber2' },
+        { label: '数据日期', prop: 'dataDate' },
+        { label: '管户层级标识', prop: 'customerLevelIdentifier' },
+        { label: '客户类别标识', prop: 'customerCategoryIdentifier' },
+        { label: '员工分润比例', prop: 'employeeProfitSharingRatio' },
+        { label: '操作', prop: 'actions', fixed: 'right' }
+      ],
+      items: [],
+      total: 0,
+      pageInfo: {
+        current: 1,
+        size: 10
+      },
+      loading: false
+    }
+  },
+  created () {
+    this.onInit()
+  },
+  methods: {
+    async onInit () {
+      this.loading = true
+      try {
+        const { data } = await getCustomerProfitSharingClaim({
+          ...this.pageInfo,
+          ...this.searchValues
+        })
+        this.items = data.records
+        this.total = data.total
+      } catch (error) {
+        this.$message.error(error)
+      } finally {
+        this.loading = false
+      }
+    },
+    onClaim (item) {
+      this.$refs.claimFormRef.open(item)
+    },
+    onSearch () {
+      this.pageInfo.current = 1
+      this.onInit()
+    },
+    onPageChange (index) {
+      this.pageInfo.current = index
+      this.onInit()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+  /* 自定义样式 */
+</style>

+ 28 - 0
src/views/salary/claim/subBranch/index.vue

@@ -0,0 +1,28 @@
+<template>
+  <div>
+    <table-page ref="tableRef" type="0" />
+  </div>
+</template>
+
+<script>
+// 支行业绩分润
+import TablePage from '../components/table.vue'
+export default {
+  name: 'salaryClaimSubBranch',
+  components: {
+    TablePage
+  },
+  data () {
+    return {}
+  },
+  methods: {
+    onInit () {
+      this.$refs.tableRef.onInit()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+  /* 自定义样式 */
+</style>