|
|
@@ -0,0 +1,472 @@
|
|
|
+<template>
|
|
|
+ <div v-loading="loading">
|
|
|
+ <div class="white-box">
|
|
|
+ <div class="filter-box">
|
|
|
+ <filter-user
|
|
|
+ ref="filterUser"
|
|
|
+ :filter-types="filterTypes"
|
|
|
+ @select-value="handleFilterUser"
|
|
|
+ ></filter-user>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-table :data="tableData" stripe style="width: 100%">
|
|
|
+ <el-table-column
|
|
|
+ v-for="(tableHeader, key) in tableHeaders"
|
|
|
+ :key="key"
|
|
|
+ :label="tableHeader.header"
|
|
|
+ >
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <template v-if="row[tableHeader.index].other.tag">
|
|
|
+ <el-tag
|
|
|
+ :type="
|
|
|
+ row[tableHeader.index].other.tag.type
|
|
|
+ ? row[tableHeader.index].other.tag.type
|
|
|
+ : null
|
|
|
+ "
|
|
|
+ :size="
|
|
|
+ row[tableHeader.index].other.tag.size
|
|
|
+ ? row[tableHeader.index].other.tag.size
|
|
|
+ : null
|
|
|
+ "
|
|
|
+ :class="
|
|
|
+ row[tableHeader.index].other.tag.class
|
|
|
+ ? row[tableHeader.index].other.tag.class
|
|
|
+ : null
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ style="
|
|
|
+ word-break: keep-all;
|
|
|
+ word-wrap: break-word;
|
|
|
+ white-space: pre-wrap;
|
|
|
+ "
|
|
|
+ >{{ row[tableHeader.index].value }}</span
|
|
|
+ >
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ <template v-else-if="row[tableHeader.index].other.progress">
|
|
|
+ <el-progress
|
|
|
+ type="circle"
|
|
|
+ :percentage="
|
|
|
+ Number.parseInt(percentList['MOVE_PERCENT'][row.ID])
|
|
|
+ "
|
|
|
+ :width="50"
|
|
|
+ :stroke-width="3"
|
|
|
+ ></el-progress>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <div v-html="row[tableHeader.index].value"></div>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <div class="white-box-footer">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ @click="dialog = true"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ v-show="permission.hasPermission(`user/change-user-dec-level`)"
|
|
|
+ >{{ $t("member.changeHighestEmpLevel") }}</el-button
|
|
|
+ >
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="total > 0"
|
|
|
+ :total="total"
|
|
|
+ :page_size="pageSize"
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- -->
|
|
|
+ <el-dialog
|
|
|
+ :title="$t('member.changeHighestEmpLevel')"
|
|
|
+ :visible.sync="dialog"
|
|
|
+ :width="screenWidth"
|
|
|
+ style="margin-top: -80px"
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ ref="form"
|
|
|
+ :model="form"
|
|
|
+ label-width="170px"
|
|
|
+ :label-position="labelPosition"
|
|
|
+ >
|
|
|
+ <el-form-item :label="$t('member.memberCode')" required>
|
|
|
+ <el-input
|
|
|
+ :placeholder="$t('member.pleaseInputMemberCode')"
|
|
|
+ @input="userNameInput"
|
|
|
+ v-model.trim="form.userName"
|
|
|
+ class="input-with-select"
|
|
|
+ >
|
|
|
+ <el-button slot="append" icon="el-icon-search" @click="handleQuery"
|
|
|
+ >{{ $t("member.userInfoQuery") }}</el-button
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+
|
|
|
+ <el-tag v-show="userInfo.REAL_NAME !== null" style="margin-top: 5px">
|
|
|
+ {{ $t("member.memberName") }}:{{ userInfo.REAL_NAME }}
|
|
|
+ </el-tag>
|
|
|
+ <el-tag
|
|
|
+ v-show="userInfo.REAL_NAME !== null"
|
|
|
+ v-for="(item, key) in empLevels"
|
|
|
+ :label="item.LEVEL_NAME"
|
|
|
+ :value="item.ID"
|
|
|
+ :key="key"
|
|
|
+ v-if="key === userInfo.EMP_LV"
|
|
|
+ style="margin-top: 5px"
|
|
|
+ >
|
|
|
+ {{ $t("member.highestLevel") }}:{{ item.LEVEL_NAME }}
|
|
|
+ </el-tag>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('member.modifyHighestDirectorLevelLevel')" required>
|
|
|
+ <el-select
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="form.levelId"
|
|
|
+ :placeholder="$t('member.selectDirectorLevelHint')"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, key) in empLevels"
|
|
|
+ :label="item.LEVEL_NAME"
|
|
|
+ :value="item.ID"
|
|
|
+ :key="key"
|
|
|
+ :disabled="key === userInfo.EMP_LV"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('member.remark')">
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ :rows="2"
|
|
|
+ placeholder=""
|
|
|
+ v-model="form.remark"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :loading="submitButtonStat"
|
|
|
+ @click="onSubmit"
|
|
|
+ >{{ $t("common.confirm") }}</el-button
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {
|
|
|
+changeHighestEmpLevelList,
|
|
|
+fetchMemberFullInfo,
|
|
|
+updateHighestEmpLevel
|
|
|
+} from "@/api/member";
|
|
|
+import FilterUser from "@/components/FilterUser";
|
|
|
+import Pagination from "@/components/Pagination";
|
|
|
+import { getScreenWidth } from "@/utils";
|
|
|
+import baseInfo from "@/utils/baseInfo";
|
|
|
+import filterHelper from "@/utils/filterHelper";
|
|
|
+import permission from "@/utils/permission";
|
|
|
+import tool from "@/utils/tool";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "memberHighestEmpLevelAdjustment",
|
|
|
+ components: { FilterUser, Pagination },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tableHeaders: null,
|
|
|
+ tableData: null,
|
|
|
+ loading: false,
|
|
|
+ tool: tool,
|
|
|
+ permission: permission,
|
|
|
+ // allDecLevel: baseInfo.decLevels(),
|
|
|
+ empLevels: baseInfo.empLevels(),
|
|
|
+ filterTypes: {},
|
|
|
+ filterModel: {},
|
|
|
+ filterStatus: "0",
|
|
|
+ total: 0,
|
|
|
+ page: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ currentPage: 1,
|
|
|
+
|
|
|
+ screenWidth: getScreenWidth() > 500 ? "500px" : getScreenWidth() + "px",
|
|
|
+ labelPosition: getScreenWidth() >= 500 ? "right" : "top",
|
|
|
+
|
|
|
+ submitButtonStat: false,
|
|
|
+ dialog: false,
|
|
|
+ form: {
|
|
|
+ userName: null,
|
|
|
+ periodNum: null,
|
|
|
+ levelId: null,
|
|
|
+ remark: null,
|
|
|
+ },
|
|
|
+ userInfo: {
|
|
|
+ REAL_NAME: null,
|
|
|
+ DEC_LV: null,
|
|
|
+ },
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getData();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //now
|
|
|
+ onSubmit() {
|
|
|
+ let that = this
|
|
|
+
|
|
|
+ if (!that.form.userName.length) {
|
|
|
+ that.$message({
|
|
|
+ message: that.$t("member.pleaseInputMemberCode"),
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (!that.form.levelId) {
|
|
|
+ that.$message({
|
|
|
+ message: that.$t("member.pleaseSelectDirectorLevel"),
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ that.$confirm(that.$t("member.modifyHighestDirectorLevelHits"), that.$t("common.hint"), {
|
|
|
+ confirmButtonText: that.$t("article.confirm"),
|
|
|
+ cancelButtonText: that.$t("article.cancel"),
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ that._handleSubmit()
|
|
|
+ }).catch(() => {
|
|
|
+ that._clearData()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ _handleSubmit() {
|
|
|
+ this.submitButtonStat = true
|
|
|
+ updateHighestEmpLevel(this.form)
|
|
|
+ .then((response) => {
|
|
|
+ this.$message({
|
|
|
+ message: response.data,
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ this.submitButtonStat = false;
|
|
|
+ }, 0.5 * 1000);
|
|
|
+
|
|
|
+ this.submitButtonStat = false;
|
|
|
+ this._clearData();
|
|
|
+ this.dialog = false;
|
|
|
+ this.getData();
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+
|
|
|
+ this.submitButtonStat = false;
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ getData(page, pageSize) {
|
|
|
+ this.loading = true;
|
|
|
+ const paramsData = Object.assign(
|
|
|
+ {
|
|
|
+ page: page === null || page == undefined ? 1 : page,
|
|
|
+ pageSize:
|
|
|
+ pageSize === null || pageSize == undefined
|
|
|
+ ? this.pageSize
|
|
|
+ : pageSize,
|
|
|
+ filterStatus: this.filterStatus != -1 ? `=,${this.filterStatus}` : "",
|
|
|
+ },
|
|
|
+ this.filterModel
|
|
|
+ );
|
|
|
+ changeHighestEmpLevelList(paramsData)
|
|
|
+ .then((response) => {
|
|
|
+ this.filterTypes = response.data.filterTypes;
|
|
|
+ this.tableData = response.data.list;
|
|
|
+ this.total = +response.data.totalCount;
|
|
|
+ this.currentPage = page;
|
|
|
+ this.pageSize = pageSize;
|
|
|
+ this.filterTypes = response.data.filterTypes;
|
|
|
+ this.tableHeaders = response.data.columnsShow;
|
|
|
+
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleClose() {
|
|
|
+ this._clearData();
|
|
|
+ this.dialog = false;
|
|
|
+ },
|
|
|
+ handleQuery() {
|
|
|
+ if (!this.form.userName.length) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("member.pleaseInputMemberCode"),
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ fetchMemberFullInfo({ userName: this.form.userName })
|
|
|
+ .then((response) => {
|
|
|
+ this.userInfo = response.data;
|
|
|
+ this.submitButtonStat = false;
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ this.userInfo.REAL_NAME = null;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ this.submitButtonStat = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ userNameInput(val) {
|
|
|
+ console.log(val);
|
|
|
+ if (val == "") {
|
|
|
+ this.userInfo.REAL_NAME = null;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //before
|
|
|
+ handleChange() {
|
|
|
+ this.submitButtonStat = true;
|
|
|
+ fetchMemberFullInfo({ userName: this.form.userName })
|
|
|
+ .then((response) => {
|
|
|
+ this.userInfo = response.data;
|
|
|
+ this.submitButtonStat = false;
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ this.userInfo.REAL_NAME = null;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ this.submitButtonStat = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleFilterUser(filterData) {
|
|
|
+ filterHelper.handleFilterUser(this, filterData);
|
|
|
+ },
|
|
|
+ handleCurrentChange(page) {
|
|
|
+ this.getData(page, this.pageSize);
|
|
|
+ },
|
|
|
+ handleSizeChange(pageSize) {
|
|
|
+ this.getData(this.currentPage, pageSize);
|
|
|
+ },
|
|
|
+ // getData(page, pageSize) {
|
|
|
+ // this.loading = true;
|
|
|
+ // const paramsData = Object.assign(
|
|
|
+ // {
|
|
|
+ // page: page === null || page == undefined ? 1 : page,
|
|
|
+ // pageSize:
|
|
|
+ // pageSize === null || pageSize == undefined
|
|
|
+ // ? this.pageSize
|
|
|
+ // : pageSize,
|
|
|
+ // },
|
|
|
+ // this.filterModel
|
|
|
+ // );
|
|
|
+ // fetchEntryLevelList(paramsData)
|
|
|
+ // .then((response) => {
|
|
|
+ // this.filterTypes = response.data.filterTypes;
|
|
|
+ // this.tableData = response.data.list;
|
|
|
+ // this.total = +response.data.totalCount;
|
|
|
+ // this.currentPage = page;
|
|
|
+ // this.pageSize = pageSize;
|
|
|
+ // this.filterTypes = response.data.filterTypes;
|
|
|
+ // this.tableHeaders = response.data.columnsShow;
|
|
|
+
|
|
|
+ // this.loading = false;
|
|
|
+ // })
|
|
|
+ // .catch((error) => {
|
|
|
+ // this.$message({
|
|
|
+ // message: error,
|
|
|
+ // type: "warning",
|
|
|
+ // });
|
|
|
+ // this.loading = false;
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // onSubmit() {
|
|
|
+ // this.$confirm(
|
|
|
+ // this.$t("member.modifyMemberEntryLevelHits"),
|
|
|
+ // this.$t("common.hint"),
|
|
|
+ // {
|
|
|
+ // confirmButtonText: this.$t("common.confirm"),
|
|
|
+ // cancelButtonText: this.$t("common.cancel"),
|
|
|
+ // type: "warning",
|
|
|
+ // }
|
|
|
+ // )
|
|
|
+ // .then(() => {
|
|
|
+ // this._handleSubmit();
|
|
|
+ // })
|
|
|
+ // .catch((error) => {
|
|
|
+ // this.$message({
|
|
|
+ // message: error,
|
|
|
+ // type: "warning",
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // _handleSubmit() {
|
|
|
+ // this.submitButtonStat = true;
|
|
|
+ // updateUserEntryLevel(this.form)
|
|
|
+ // .then((response) => {
|
|
|
+ // this.$message({
|
|
|
+ // message: response.data,
|
|
|
+ // type: "success",
|
|
|
+ // });
|
|
|
+
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.submitButtonStat = false;
|
|
|
+ // }, 0.5 * 1000);
|
|
|
+
|
|
|
+ // this.submitButtonStat = false;
|
|
|
+ // this._clearData();
|
|
|
+ // this.dialog = false;
|
|
|
+ // this.getData();
|
|
|
+ // })
|
|
|
+ // .catch((error) => {
|
|
|
+ // this.$message({
|
|
|
+ // message: error,
|
|
|
+ // type: "warning",
|
|
|
+ // });
|
|
|
+
|
|
|
+ // this.submitButtonStat = false;
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ _clearData() {
|
|
|
+ this.form = {
|
|
|
+ userName: null,
|
|
|
+ periodNum: null,
|
|
|
+ levelId: null,
|
|
|
+ remark: null,
|
|
|
+ };
|
|
|
+ this.userInfo = {
|
|
|
+ REAL_NAME: null,
|
|
|
+ DEC_LV: null,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+.app-main {
|
|
|
+ padding: 15px;
|
|
|
+}
|
|
|
+.app-container {
|
|
|
+ padding: 0;
|
|
|
+}
|
|
|
+.white-box {
|
|
|
+ padding: 15px;
|
|
|
+}
|
|
|
+.form-page {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+</style>
|