index.vue 9.63 KB
<template>
    <div class="main">
        <table  cellspacing="0" cellpadding="0" border="1">
            <thead>
            <tr rowspan="2">
                <td colspan="4">
                    <div class="dw">
                        单位 :
                        <el-radio-group v-model="mjdw">
                            <el-radio :label="3">平方米</el-radio>
                            <el-radio :label="6">公顷</el-radio>
                            <el-radio :label="9"></el-radio>
                        </el-radio-group>
                    </div>
                </td>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td class="tdright">权利人</td>
                <td colspan="3">
                   <input class="formInput" v-model="qlr" disabled/>
                </td>
            </tr>
            <tr>
                <td class="tdright">宗地代码</td>
                <td colspan="3">
                    <input class="formInput" v-model="zddm" disabled/>
                </td>
            </tr>
            <tr>
                <td class="tdright">不动产单元号</td>
                <td colspan="3">
                    <input class="formInput" v-model="bdcdyh" disabled/>
                </td>
            </tr>
            <tr >
                <td rowspan="7" class="tdright">
                   分类面积
                </td>
                <td colspan="2" class="tdright">农用地</td>
                <td>
                    <input class="formInput" v-model="flmjData.nyd" oninput="value = (value.match(/^\d{0,8}(\.?\d{0,3})/g)[0]) || null"/>
                </td>
            </tr>
            <tr>
                <td rowspan="4" class="tdright">
                    其他
                </td>
                <td class="tdright">
                    耕地
                </td>
                <td colspan="2">
                    <input class="formInput" v-model="flmjData.nydgd" oninput="value = (value.match(/^\d{0,8}(\.?\d{0,3})/g)[0]) || null"/>
                </td>
            </tr>
            <tr>
                <td class="tdright">林地</td>
                <td colspan="2">
                    <input class="formInput" v-model="flmjData.nydld" oninput="value = (value.match(/^\d{0,8}(\.?\d{0,3})/g)[0]) || null"/>
                </td>
            </tr>
            <tr>
                <td class="tdright">
                    草地
                </td>
                <td colspan="2">
                    <input class="formInput" v-model="flmjData.nydcd" oninput="value = (value.match(/^\d{0,8}(\.?\d{0,3})/g)[0]) || null" />
                </td>
            </tr>
            <tr>
                <td class="tdright">其他</td>
                <td colspan="2">
                    <input class="formInput" v-model="flmjData.nydqt " oninput="value = (value.match(/^\d{0,8}(\.?\d{0,3})/g)[0]) || null"/>
                </td>
            </tr>
            <tr>
                <td class="tdright">建设用地</td>
                <td colspan="3">
                    <input class="formInput" v-model="flmjData.jzyd" oninput="value = (value.match(/^\d{0,8}(\.?\d{0,3})/g)[0]) || null"/>
                </td>
            </tr>
            <tr>
                <td class="tdright">
                    未利用地
                </td>
                <td colspan="3">
                    <input class="formInput" v-model="flmjData.wlyd" oninput="value = (value.match(/^\d{0,8}(\.?\d{0,3})/g)[0]) || null"/>
                </td>
            </tr>
            <tr>
                <td rowspan="2" class="tdright">调查记事</td>
                <td colspan="3">
                    <input class="formInput"  type="textarea"
                               :autosize="{ minRows: 2, maxRows: 4}" v-model="flmjData.dcjs"/>
                </td>
            </tr>
            <tr>
                <td colspan="3" class="tdright">

                    <el-form :inline="true" :model="flmjData" class="demo-form-inline">
                        <el-form-item label="调查员:">
                            <input class="formInput" v-model="flmjData.dcy" />
                        </el-form-item>
                        <el-form-item label="日期:">
                            <input class="formInput"
                                    placeholder="请选择日期"
                                    title="调查日期"
                                    type="date"
                                    v-model="flmjData.dcrq">
                            
                        </el-form-item>
                    </el-form>
                </td>
            </tr>
            <tr>
                <td rowspan="2" class="tdright">审核意见</td>
                <td colspan="3">
                    <input class="formInput"  type="textarea"
                               :autosize="{ minRows: 2, maxRows: 4}" v-model="flmjData.shyj"/>
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    <el-form :inline="true" :model="flmjData" class="demo-form-inline">
                        <el-form-item label="审核员:">
                            <input class="formInput" v-model="flmjData.shy" />
                        </el-form-item>
                        <el-form-item label="日期:">
                            <input class="formInput"
                                    placeholder="请选择日期"
                                    title="调查日期"
                                    type="date"
                                    v-model="flmjData.shrq">
                            
                        </el-form-item>
                    </el-form>
                </td>
            </tr>
            <tr>
                <td colspan="4" style="text-align: center">
                    <el-button type="primary" @click="save">保存</el-button>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</template>

<script>
    import {getFlDc,updateFldc} from '@api/zd'
    export default {
        name: "Fldcb",
        props:{
            qlr:{
                type:String
            },
            bdcdyh:{
                type:String
            },
            zddm:{
                type:String
            }
        },
        data(){
            return{
                // zdbsm:'',
                mjdw:'',
                flmjData:{
                    zdbsm:'',
                    mjdw :'',      // 单位
                    zddm:'',    // 宗地代码
                    nyd :'',     // 农用地
                    nydgd :'',      // 耕地
                    nydld :'',      // 林地
                    nydcd :'',       // 草地
                    nydqt :'',         //其他
                    jsyd:'',      // 建设用地
                    wlyd:'',      // 未利用地
                    dcjs :"",     // 调查记事
                    dcy:'',        // 调查员
                    dcrq:'',      // 调查日期
                    shyj:'',      // 审核意见
                    shr :'',       // 审核员
                    shrq:''        // 审核日期
                }
            }
        },
        mounted(){
            this.info(this.$route.query.bsm)
            this.flmjData.zdbsm=this.$route.query.bsm;
        },
        methods:{
            info(zdbsm){
                getFlDc(zdbsm).then(res=>{
                    if (res.success) {
                        console.log(res,'获取信息')
                        this.flmjData= res.result[0] || this.flmjData;
                    }
                })
            },
            save(){
                updateFldc(this.flmjData).then(res=>{
                    if (res.success) {
                        console.log(res,"保存成功")
                        this.$message.success("保存成功")
                    }
                })
            },
            result(){
                this.flmjData={
                    mjdw:'',      // 单位
                    qlr:'',     // 权利人
                    zddm:'',    // 宗地代码
                    bdcdyh:'',  // 不动产单元号
                    lyd:'',     // 农用地
                    gd:'',      // 耕地
                    ld:'',      // 林地
                    cd:'',       // 草地
                    qt:'',         //其他
                    jzyd:'',      // 建设用地
                    wlyd:'',      // 未利用地
                    dcjs:"",     // 调查记事
                    dcy:'',        // 调查员
                    dcrq:'',      // 调查日期
                    shyj:'',      // 审核意见
                    shrmc:'',       // 审核员
                    shrq:''        // 审核日期
                }
            }
        },
        watch:{
            "$store.state.zddm": function (zddm) {
                this.zddm = zddm
            },
            "$route.query.bsm": function (bsm) {
                this.mjftData.zdbsm = bsm
                this.info(bsm);
            },
        }
    }
</script>

<style scoped lang="less">
    table{
        margin-top: 20px;
        background-color: #fff;
        font-size: 14px;
        width: 100%;
        cursor: pointer;
        .el-radio-group{
            margin-left: 10px;
        }
        .el-radio {
            margin-right: 20px !important;
        }
        th {
            height: 36px;
            line-height: 36px;
            font-size: 16px;
        }
        td {
            text-align: center;
            height: 36px;
            border-color: #E6E6E6;
        }
    }
    .dw{
        float: right;
        margin-right: 10px;
    }
    .demo-form-inline{
        float: right;
    }
</style>