Blame view

src/components/plc/plC.vue 6.42 KB
weimo934 committed
1 2
<template>
    <div>
3
        <el-dialog v-dialogDrag :close-on-click-modal="false"
4
                title="批量层"
weimo934 committed
5 6 7 8
                :visible.sync="isVisible"
                width="50%"
                @close="close"
                :modal-append-to-body="false"
9
                >
weimo934 committed
10 11 12
            <div>
                <table border="1">
                    <tr>
zhaoqian committed
13
                        <td class="tdright">层建筑面积(㎡)</td>
weimo934 committed
14
                        <td>
15
                            <el-input  v-model="qlcData.cjzmj" oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null" ></el-input>
weimo934 committed
16
                        </td>
zhaoqian committed
17
                        <td class="tdright">
18
                            层套内建筑面积(㎡)
weimo934 committed
19 20
                        </td>
                        <td>
21
                            <el-input  v-model="qlcData.ctnjzmj" oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null"  ></el-input>
weimo934 committed
22 23 24
                        </td>
                    </tr>
                    <tr>
zhaoqian committed
25
                        <td class="tdright">层阳台面积(㎡)</td>
weimo934 committed
26
                        <td>
27
                            <el-input  v-model="qlcData.cytmj" class="" oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null" ></el-input>
weimo934 committed
28
                        </td>
zhaoqian committed
29
                        <td class="tdright">
30
                            层半墙面积(㎡)
weimo934 committed
31 32
                        </td>
                        <td>
33
                            <el-input  v-model="qlcData.cbqmj" class="" oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null" ></el-input>
weimo934 committed
34 35 36
                        </td>
                    </tr>
                    <tr>
zhaoqian committed
37
                        <td class="tdright">层共有建筑面积(㎡)</td>
weimo934 committed
38
                        <td>
39
                            <el-input  v-model="qlcData.cgyjzmj" class="" oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null" ></el-input>
weimo934 committed
40
                        </td>
zhaoqian committed
41
                        <td class="tdright">
weimo934 committed
42 43 44
                            层分摊建筑面积(㎡)
                        </td>
                        <td>
45
                            <el-input  v-model="qlcData.cftjzmj" class="" oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null" placeholder="层分摊建筑面积(㎡)"></el-input>
weimo934 committed
46 47 48
                        </td>
                    </tr>
                    <tr>
zhaoqian committed
49
                        <td class="tdright">层高(m)</td>
weimo934 committed
50
                        <td>
51
                            <el-input  v-model="qlcData.cg" class="" oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null" placeholder="层高(m)"></el-input>
weimo934 committed
52
                        </td>
zhaoqian committed
53
                        <td class="tdright">
weimo934 committed
54 55 56
                            水平投影面积(㎡)
                        </td>
                        <td>
57
                            <el-input v-model="qlcData.sptymj" class="" oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null" placeholder="水平投影面积(㎡)"></el-input>
weimo934 committed
58 59 60 61 62 63
                        </td>
                    </tr>
                </table>
            </div>
            <div class="shop">
                <el-button type="primary" @click="save">保存</el-button>
焦泽平 committed
64
                <el-button type="primary" @click="result" icon="el-icon-refresh">重置</el-button>
weimo934 committed
65 66 67 68 69 70 71
                <el-button type="primary" @click="cancel">取消</el-button>
            </div>
        </el-dialog>
    </div>
</template>

<script>
杨威 committed
72
    import {updatePlc} from '@api/zrz'
weimo934 committed
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
    import {Message} from 'element-ui'

    export default {
        name: "plC",
        data() {
            return {
                isVisible: false,
                qlcData: {
                    cbqmj: '',           // 层半墙面积
                    cftjzmj: '',         // 层分摊建筑面积
                    cg: '',              // 层高
                    cgyjzmj: '',         // 层共有建筑面积
                    cjzmj: '',           // 层建筑面积
                    ctnjzmj: '',         // 层套内建筑面积
                    cytmj: '',           // 层阳台面积
                    sptymj: ''           // 水平投影面积
                }
            }
        },
        props: {
            bsms: {
                type: Array,
            },
            plcVisible: {
                type: Boolean,
                default: function () {
                    return false
                }
            }
        },
        methods: {
104 105 106
            lodding:function(){
                this.$emit('lodding')
            },
weimo934 committed
107 108 109 110 111 112
            save: function () {
                this.qlcData['bsms'] = this.bsms
                updatePlc(this.qlcData).then(res => {
                    console.log(res)
                    if (res.success) {
                        Message.success("保存成功")
113
                        this.lodding()
weimo934 committed
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
                        this.close()
                    } else {
                        Message.error(res.message)
                    }
                })
            },
            close: function () {
                this.$emit('close')
                this.isVisible = false
                this.result()
            },
            cancel: function () {
                this.$emit('close')
                this.isVisible = false
            },
            result: function () {
                this.qlcData = {
                    cbqmj: '',           // 层半墙面积
                    cftjzmj: '',         // 层分摊建筑面积
                    cg: '',              // 层高
                    cgyjzmj: '',         // 层共有建筑面积
                    cjzmj: '',           // 层建筑面积
                    ctnjzmj: '',         // 层套内建筑面积
                    cytmj: '',           // 层阳台面积
                    sptymj: ''           // 水平投影面积
                }
            }
        },
        watch: {
            plcVisible(val) {
                this.isVisible = val
            }
        }
    }
</script>

<style scoped>
    table {
        margin-top: 10px;
        background-color: #fff;
        font-size: 14px;
        width: 100%;
    }

    td {
        text-align: center;
        height: 36px;
        min-width: 50px;
    }

    table:hover {
        cursor: pointer;
    }

    .inputtitle {
169
        line-height: 41px;
weimo934 committed
170 171
        width: 95%;
        border: none;
172 173
        height: 98%;
        outline: none;
weimo934 committed
174 175 176 177 178 179 180 181
    }


    .shop {
        margin-top: 20px;
        text-align: center;
    }
</style>