“dzb”
2022-10-03 4d9a35462803c7392dedca8d95fe21ff3d949466
src/views/operate/disposal/casepool/escalation/createUser/index.vue
@@ -1,195 +1,49 @@
<template>
    <div class="createUser">
        <main>
            <div class="mainContent">
                <el-form ref="user" label-width="140px" autoComplete="on" :model="things" label-position="right">
                    <!-- 违规事项编号 -->
                    <el-form-item class="optionItem" label="违规事项编号:" prop="number">
                        <el-input v-model="things.number" placeholder="请填写违规事项编号"></el-input>
                    </el-form-item>
                    <!-- 所属类型 -->
                    <el-form-item class="optionItems" label="所属类型:" prop="typeThird">
                        <el-select v-model="things.typeThird" placeholder="请选择所属类型" >
                            <el-option v-for="item in typeThirdList" :key="item.id" :label="item.name"
                                :value="item.id">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <!-- 所属大类 -->
                    <el-form-item class="optionItem" label="所属大类:" prop="typeSecond">
                        <el-select v-model="things.typeSecond" placeholder="请选择所属类型" >
                            <el-option v-for="item in typeSecondList" :key="item.id" :label="item.name"
                                :value="item.id">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <!-- 所属小类 -->
                    <el-form-item class="optionItem" label="所属小类:" prop="typeFirst">
                        <el-select v-model="things.typeFirst" placeholder="请选择所属类型" disabled>
                            <el-option v-for="item in typeFirstList" :key="item.id" :label="item.name"
                                :value="item.id">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <!-- 案由 -->
                    <el-form-item class="optionItem" label="案由:" prop="type">
                        <el-input type="textarea" autosize v-model="things.type" placeholder="请输入案由描述内容"
                            :disabled="!updateFlag" disabled></el-input>
                    </el-form-item>
                    <el-form-item v-if="updateFlag">
                        <div class="optionBtn">
                            <el-button type="primary" class="btn submit" @click.native.prevent="handleUser">确认
                            </el-button>
                        </div>
                    </el-form-item>
                </el-form>
            </div>
        </main>
        <div class="chooseArea">
            <el-button type="primary" @click="toShow(0,'违规')">违规登记</el-button>
            <el-button type="primary" @click="toShow(1,'违建')">违建登记</el-button>
        </div>
    </div>
</template>
<script>
export default {
    data() {
        return {
            things: {
                number: 0,
                type: '',
                typeFirst: '',
                typeSecond: '',
                typeThird: '',
            },
            roleList: [],
            typeThirdList:[],
            typeSecondList:[],
            typeFirstList:[],
        }
    },
    created() {
        console.log(this.userInfo);
        this.things = JSON.parse(JSON.stringify(this.userInfo));
        // 获取所属类型列表
        this.getTypeThird();
        this.getTypeSecond();
        this.getTypeFirst();
    },
    methods: {
        // handleUser() {
        //     this.$refs.user.validate((valid) => {
        //         if (valid) {
        //             const { role } = this;
        //             console.log(role);
        //             this.$axios.post('/sccg/role/update/' + role.id, {
        //                 id: role.id,
        //                 status: role.status,
        //                 description: role.description,
        //                 name: role.name,
        //                 sort: 0
        //             }).then(res => {
        //                 this.$emit('changeDialog', { dialogUpdate: false });
        //                 this.getUserList();
        //             })
        //         } else {
        //             return false;
        //         }
        //     })
        // },
        // 查询所属类型
        getTypeThird() {
            this.$axios({
                method: 'get',
                url: "sccg/violations/query/type_first",
            })
                .then(res => {
                    this.typeThirdList = res.data;
        toShow(idx, lab) {
            this.$confirm('您确定要去上报' + lab + '事件')
                .then(_ => {
                    this.$emit('getPageProp',{flag:false,type:idx});
                })
        },
        // 查询所属大类
        getTypeSecond(){
            this.$axios({
                method: 'get',
                url: "sccg/violations/query/type_second",
            })
                .then(res => {
                    this.typeSecondList = res.data;
                })
        },
        // 查询所属小类
        getTypeFirst(){
            this.$axios({
                method: 'get',
                url: "sccg/violations/query/type_third",
            })
                .then(res => {
                    this.typeFirstList = res.data;
                })
                .catch(_ => { console.log('err') });
        }
    },
    props: ['getUserList']
    props:['getPageProp']
}
</script>
<style lang="scss" scoped>
.createUser {
    border-radius: 1px;
    background-color: #09152f;
.chooseArea {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 50px;
    padding-bottom: 80px;
    main {
        // border: 1px solid #fff;
        text-align: left;
        padding: 0 55px;
        background-color: #09152f;
        padding-bottom: 50px;
        .mainContent {
            display: flex;
            justify-content: center;
            padding-top: 50px;
            .el-form-item__content {
                width: 400px;
                .el-select {
                    width: 100%;
                }
            }
            .optionHandleSp {
                display: flex;
                .areaNumber,
                .moreNumber {
                    flex: 1;
                }
                .telNumber {
                    flex: 2;
                }
            }
            .optionBtn {
                display: flex;
                margin-top: 20px;
                .btn {
                    padding: 12px 50px;
                }
            }
        }
    .el-button {
        width: 120px;
        line-height: 40px;
        padding: 0;
        margin-top: 20px;
    }
    &::v-deep .el-textarea__inner {
        background-color: #09152f;
        border: 1px solid #17324c;
    }
    ::v-deep .el-form-item__label {
        color: #4b9bb7;
    }
    ::v-deep .el-input__inner {
        background-color: #09152f;
        border: 1px solid #17324c;
    .el-button+.el-button {
        margin-left: 0;
    }
}
</style>