“dzb”
2022-10-10 676722551d0bc2f8caa0644961e60deef3f0d532
src/views/systemSetting/baseSetting/department/index.vue
@@ -12,7 +12,7 @@
                <div class="addUser">
                    <el-button class="addBtn" type="primary" @click="dialogCreate = true">新增部门</el-button>
                    <el-dialog :visible.sync="dialogCreate" title="新增部门信息" width="45%" v-if="dialogCreate"
                        :before-close="handleClose">
                        :before-close="handleClose2">
                        <createUser :refresh="context==='' ? getUserList : search " @changMyDialog="changMyDialog" />
                    </el-dialog>
                </div>
@@ -36,8 +36,8 @@
                    </el-table-column>
                    <el-table-column prop="departDes" label="部门描述" min-width="10">
                    </el-table-column>
                    <el-table-column prop="createTime" label="创建时间" min-width="10">
                    </el-table-column>
                    <!-- <el-table-column prop="createTime" label="创建时间" min-width="10">
                    </el-table-column> -->
                    <el-table-column prop="status" label="启用" min-width="5">
                        <template slot-scope="scope">
                            <el-switch class="switchStyle" v-model="scope.row.status" active-text="开" inactive-text="关"
@@ -94,7 +94,6 @@
<script>
import createUser from "./createUser"
import updateUser from "./updateUser"
import helper from "@/utils/mydate.js"
export default {
    components: {
        createUser, updateUser
@@ -191,9 +190,6 @@
                this.all = false
            }
        },
        changeTime({ createTime }) {
            return helper(createTime);
        },
        selectAll() {
            this.$refs.multipleTable.toggleAllSelection();
@@ -228,11 +224,10 @@
                })
                .catch(_ => { });
        },
        // 修改用户状态
        // 修改状态
        handleChangeStatus(obj) {
            let { id, status } = obj;
            status == true ? status = 1 : status = 0;
            console.log(id, status);
            this.$axios.post(`sccg/depart/status`, { id: id, status: status }).then(res => {
                if (res.code == 200) {
                    this.getUserList();
@@ -247,8 +242,7 @@
            this.$axios.get('sccg/depart/page').then(res => {
                if (res.code === 200) {
                    res.data.records.forEach(item => {
                        item.createTime = helper(item.createTime);
                        item.status == 1 ? item.status = true : item.status = false;
                        item.status == 0 ? item.status = false : item.status = true;
                    })
                    that.totalNum = res.data.records.length;
                    that.tableData = res.data.records.slice((that.currentPage - 1) * that.pageSize, that.currentPage * that.pageSize)
@@ -262,7 +256,6 @@
            this.$axios.get('sccg/depart/page', { params: { currentPage: this.currentPage, pageSize: this.pageSize, departName: this.context } }).then(res => {
                if (res.code === 200) {
                    res.data.records.forEach(item => {
                        item.createTime = helper(item.createTime);
                        item.status == 1 ? item.status = true : item.status = false;
                    })
                    that.totalNum = res.data.records.length;
@@ -307,15 +300,26 @@
            this.search();
        },
        // 关闭dialog
        changMyDialog({flag}) {
        changMyDialog({ flag }) {
            this.dialogUpdate = flag;
            this.dialogCreate = flag;
        },
        handleClose(done) {
            if (this.updateFlag) {
                this.$confirm('确认关闭?')
                    .then(_ => {
                        this.dialogUpdate = false;
                        this.dialogCreate = false;
                        done();
                    })
                    .catch(_ => { });
            } else {
                done();
            }
        },
        handleClose2(done) {
            this.$confirm('确认关闭?')
                .then(_ => {
                    this.dialogUpdate = false;
                    this.dialogCreate = false;
                    done();
                })
                .catch(_ => { });