From bf83dce33b684ba07774d74a9460c2768f848b44 Mon Sep 17 00:00:00 2001
From: “dzb” <2632970487@qq.com>
Date: 星期五, 30 九月 2022 16:29:46 +0800
Subject: [PATCH] 案件池违规、违建注册接口调试,审核页面构建

---
 src/views/operate/disposal/casepool/pool/createUser/ill/index.vue |  446 +++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 318 insertions(+), 128 deletions(-)

diff --git a/src/views/operate/disposal/casepool/pool/createUser/ill/index.vue b/src/views/operate/disposal/casepool/pool/createUser/ill/index.vue
index 848d2bf..786db34 100644
--- a/src/views/operate/disposal/casepool/pool/createUser/ill/index.vue
+++ b/src/views/operate/disposal/casepool/pool/createUser/ill/index.vue
@@ -6,70 +6,76 @@
                 <div class="input-header__tip">濉啓浜嬩欢鍩虹淇℃伅</div>
             </div>
             <div class="input-form">
-                <el-form ref="user" label-width="160px" autoComplete="on" :model="role" :rules="createRoleRules"
+                <el-form ref="user" label-width="160px" autoComplete="on" :model="ill" :rules="createillRules"
                     label-position="right">
-                    <!-- 闂绫诲瀷 -->
-                    <el-form-item class="optionItem" label="闂绫诲瀷:" prop="name">
-                        <el-select v-model="role.type" placeholder="杩濆缓">
+                    <!-- 闂绫诲瀷
+                    <el-form-item class="optionItem" label="闂绫诲瀷:" prop="category">
+                        <el-select v-model="ill.type" placeholder="杩濆缓">
                             <el-option v-for="item in typeList" :key="item.name" :label="item.name" :value="item.value"
                                 :disabled="item.disabled">
                             </el-option>
                         </el-select>
-                    </el-form-item>
+                    </el-form-item> -->
                     <!-- 杩濆缓绫诲埆 -->
-                    <el-form-item class="optionItems" label="杩濆缓绫诲埆:" prop="status">
-                        <el-select v-model="role.big" placeholder="璇烽�夋嫨杩濆缓绫诲埆" size="small">
+                    <el-form-item class="optionItems" label="杩濆缓绫诲埆:" prop="categoryId">
+                        <el-select v-model="ill.categoryId" placeholder="璇烽�夋嫨杩濆缓绫诲埆" size="small">
                             <el-option v-for="item in bigKindList" :key="item.id" :label="item.name" :value="item.id"
                                 :disabled="item.disabled">
                             </el-option>
                         </el-select>
                     </el-form-item>
                     <!-- 褰撲簨浜哄鍚� -->
-                    <el-form-item class="optionItems" label="褰撲簨浜哄鍚�:" prop="status">
-                        <el-input placeholder="璇峰~鍐欏綋浜嬩汉濮撳悕"></el-input>
+                    <el-form-item class="optionItems" label="褰撲簨浜哄鍚�:" prop="partyName">
+                        <el-input placeholder="璇峰~鍐欏綋浜嬩汉濮撳悕" v-model="ill.partyName"></el-input>
                     </el-form-item>
                     <!-- 褰撲簨浜鸿韩浠借瘉鍙� -->
-                    <el-form-item class="optionItems" label="褰撲簨浜鸿韩浠借瘉鍙�:" prop="status">
-                        <el-input placeholder="璇峰~鍐欏綋浜嬩汉韬唤璇佸彿"></el-input>
+                    <el-form-item class="optionItems" label="褰撲簨浜鸿韩浠借瘉鍙�:" prop="partyIdCard">
+                        <el-input placeholder="璇峰~鍐欏綋浜嬩汉韬唤璇佸彿" v-model="ill.partyIdCard"></el-input>
                     </el-form-item>
                     <!-- 褰撲簨浜鸿仈绯荤數璇� -->
-                    <el-form-item class="optionItem" label="褰撲簨浜鸿仈绯荤數璇�:" prop="description">
-                        <el-input v-model="role.description" placeholder="璇峰~鍐欏綋浜嬩汉鑱旂郴鐢佃瘽"></el-input>
+                    <el-form-item class="optionItem" label="褰撲簨浜鸿仈绯荤數璇�:" prop="partyPhone">
+                        <el-input v-model="ill.partyPhone" placeholder="璇峰~鍐欏綋浜嬩汉鑱旂郴鐢佃瘽"></el-input>
                     </el-form-item>
                     <!-- 杩濆缓鍦扮偣 -->
-                    <el-form-item class="optionItems" label="杩濆缓鍦扮偣:" prop="status">
-                        <el-input placeholder="璇峰~鍐欒繚寤哄湴鐐�"></el-input>
+                    <el-form-item class="optionItems" label="杩濆缓鍦扮偣:" prop="site">
+                        <el-input placeholder="璇峰~鍐欒繚寤哄湴鐐�" v-model="ill.site"></el-input>
                     </el-form-item>
                     <!-- 鎵�灞炵ぞ鍖� -->
-                    <el-form-item class="optionItems" label="鎵�灞炵ぞ鍖�:" prop="status">
-                        <el-select v-model="role.type" placeholder="璇烽�夋嫨鎵�灞炵ぞ鍖�">
-                            <el-option v-for="item in typeList" :key="item.name" :label="item.name" :value="item.value"
-                                :disabled="item.disabled">
+                    <el-form-item class="optionItems" label="鎵�灞炵ぞ鍖�:" prop="communityId">
+                        <el-select v-model="ill.communityId" placeholder="璇烽�夋嫨鎵�灞炵ぞ鍖�">
+                            <el-option v-for="item in typeList" :key="item.name" :label="item.name" :value="item.value">
                             </el-option>
                         </el-select>
                     </el-form-item>
                     <!-- 韬唤璇佹鍙嶉潰鐓х墖 -->
-                    <el-form-item class="optionItems" label="韬唤璇佹鍙嶉潰鐓х墖:" prop="status">
+                    <el-form-item class="optionItems" label="韬唤璇佹鍙嶉潰鐓х墖:" prop="positive">
                         <template>
                             <div class="idcard">
-                                <el-upload class="upload-demo"
-                                    :show-file-list = "false"
-                                    action="http://42.193.1.25:8082/sccg/file/medias"
-                                    :headers="getToken()" multiple :limit="50">
-                                    <img src="https://axure-file.lanhuapp.com/90466432-c999-4bf0-80b8-ee3f96a2099e__15f765432d579a14b8f6591c100d30e3.svg"
+                                <el-upload class="upload-demo" :show-file-list="false"
+                                    action="http://42.193.1.25:8082/sccg/file/medias" :headers="getToken()" multiple
+                                    :limit="50" :on-success="handleSuccess">
+                                    <img v-if="ill.positive === ''"
+                                        src="https://axure-file.lanhuapp.com/90466432-c999-4bf0-80b8-ee3f96a2099e__15f765432d579a14b8f6591c100d30e3.svg"
                                         alt="">
-                                        <span class="text">韬唤璇佹闈�</span>
+                                    <span class="text" v-if="ill.positive === ''">韬唤璇佹闈�</span>
+                                    <img :src="ill.positive" alt="" class="img" v-else>
                                 </el-upload>
-                                <el-upload class="upload-demo" 
-                                    :show-file-list = "false"
-                                    action="http://42.193.1.25:8082/sccg/file/medias"
-                                    :headers="getToken()" multiple :limit="50">
-                                    <img src="https://axure-file.lanhuapp.com/90466432-c999-4bf0-80b8-ee3f96a2099e__15f765432d579a14b8f6591c100d30e3.svg"
+                                <el-upload class="upload-demo" :show-file-list="false"
+                                    action="http://42.193.1.25:8082/sccg/file/medias" :headers="getToken()" multiple
+                                    :limit="50" :on-success="handleSuccess2">
+                                    <img v-if="ill.negative === '' "
+                                        src="https://axure-file.lanhuapp.com/90466432-c999-4bf0-80b8-ee3f96a2099e__15f765432d579a14b8f6591c100d30e3.svg"
                                         alt="">
-                                    <span class="text">韬唤璇佸弽闈�</span>
+                                    <span class="text" v-if="ill.negative === ''">韬唤璇佸弽闈�</span>
+                                    <img :src="ill.negative" alt="" class="img" v-else />
                                 </el-upload>
                             </div>
                         </template>
+                    </el-form-item>
+                    <!-- 鎶ヨ鏃堕棿 -->
+                    <el-form-item class="optionItems" label="鎶ヨ鏃堕棿:" prop="alarmTime">
+                        <el-date-picker v-model="ill.alarmTime" type="datetime" placeholder="閫夋嫨鎶ヨ鏃堕棿">
+                        </el-date-picker>
                     </el-form-item>
                 </el-form>
             </div>
@@ -77,25 +83,28 @@
                 <div class="not-need__header">
                     鎵ф硶杩濆缓鎯呭喌
                 </div>
-                <div class="not-need-item">
-                    <label>杩濆缓鍏蜂綋浣嶇疆:</label>
-                    <input type="text" class="not-need__inner">
-                </div>
-                <div class="not-need-item">
-                    <label>杩濇硶寤鸿闀裤�佸銆侀珮:</label>
-                    <input type="text" class="not-need__inner">
-                </div>
-                <div class="not-need-item">
-                    <label>杩濇硶寤鸿闈㈢Н:</label>
-                    <input type="text" class="not-need__inner">
-                </div>
-                <div class="not-need-item">
-                    <label>杩濇硶寤虹瓚鏉愭枡:</label>
-                    <input type="text" class="not-need__inner">
-                </div>
+                <el-form ref="condition" label-width="160px" autoComplete="on" :model="ill" :rules="createillRules">
+                    <!-- 杩濆缓鍏蜂綋浣嶇疆 -->
+                    <el-form-item class="optionItems" label="杩濆缓鍏蜂綋浣嶇疆:" prop="position">
+                        <el-input placeholder="璇峰~鍐欒繚寤哄叿浣撲綅缃�" v-model="ill.position"></el-input>
+                    </el-form-item>
+                    <el-form-item class="optionItems" label="杩濇硶寤鸿闀裤�佸銆侀珮:" prop="buildingLength">
+                        <div class="area">
+                            <el-input placeholder="鍗曚綅绫�" v-model="ill.buildingLength"></el-input>
+                            <el-input placeholder="鍗曚綅绫�" v-model="ill.buildingWidth"></el-input>
+                            <el-input placeholder="鍗曚綅绫�" v-model="ill.buildingHigh"></el-input>
+                        </div>
+                    </el-form-item>
+                    <el-form-item class="optionItems" label="杩濇硶寤鸿闈㈢Н:" prop="buildingArea">
+                        <el-input placeholder="璇峰~鍐欒繚娉曞缓璁鹃潰绉�" v-model="ill.buildingArea"></el-input>
+                    </el-form-item>
+                    <el-form-item class="optionItems" label="杩濇硶寤虹瓚鏉愭枡:" prop="materials">
+                        <el-input placeholder="璇峰~鍐欒繚娉曞缓绛戞潗鏂�" v-model="ill.materials"></el-input>
+                    </el-form-item>
+                </el-form>
             </div>
             <div class="input-footer">
-                <el-button type="primary" class="confirm">纭畾</el-button>
+                <el-button type="primary" class="confirm" @click="handleUser">纭畾</el-button>
                 <el-button class="back">杩斿洖</el-button>
             </div>
         </div>
@@ -111,72 +120,258 @@
         MyMap
     },
     data() {
-        const validateNickname = (rule, value, callback) => {
-            if (!value) {
-                callback(new Error("璇峰~鍐欓棶棰樼被鍨�"));
-            } else {
-                callback();
-            }
-        };
-        const validatePass = (rule, value, callback) => {
-            if (!value) {
-                callback();
-            } else {
-                // const rep = /^\w+$/;
-                // if (!rep.test(value)) {
-                //     callback(new Error("瀵嗙爜鍙兘鏄互鏁板瓧銆�26涓嫳鏂囧瓧姣嶆垨鑰呬笅鍒掔嚎缁勬垚鐨勫瓧绗︿覆"));
-                // }
-                callback();
-            }
-        };
-        const validateTruename = (rule, value, callback) => {
+        const checkArea = (rule, value, callback) => {
             if (value) {
                 callback();
             } else {
-                // const rep = /^[\u4E00-\u9FA5]{2,4}$/;
-                // if (!rep.test(value)) {
-                //     callback("璇疯緭鍏ユ纭殑鐢ㄦ埛濮撳悕");
-                // }
-                callback();
+                callback(new Error('杩濇硶寤鸿闈㈢Н涓嶈兘涓虹┖'))
             }
-        };
+        }
+        const checkHigh = (rule, value, callback) => {
+            if (value) {
+                callback();
+            } else {
+                callback(new Error('杩濇硶寤鸿楂樺害涓嶈兘涓虹┖'));
+
+            }
+        }
+        const checkWidth = (rule, value, callback) => {
+            if (value) {
+                callback();
+            } else {
+                callback(new Error('杩濇硶寤鸿瀹藉害涓嶈兘涓虹┖'));
+
+            }
+        }
+        const checkLength = (rule, value, callback) => {
+            if (value) {
+                callback();
+            } else {
+                callback(new Error('杩濇硶寤鸿闀垮害涓嶈兘涓虹┖'));
+
+            }
+        }
+        const checkCategoryId = (rule, value, callback) => {
+            if (value) {
+                callback();
+            } else {
+                callback(new Error('杩濆缓绫诲埆涓嶈兘涓虹┖'));
+            }
+        }
+        const checkCommunityId = (rule, value, callback) => {
+            if (value) {
+                callback();
+            } else {
+                callback(new Error('鎵�灞炵ぞ鍖轰笉鑳戒负绌�'));
+            }
+        }
+        const checkMaterials = (rule, value, callback) => {
+            if (value) {
+                callback();
+            } else {
+                callback(new Error('杩濇硶寤虹瓚鏉愭枡涓嶈兘涓虹┖'));
+            }
+        }
+        const checkIdCard = (rule, value, callback) => {
+            if (value) {
+                callback();
+            } else {
+                callback(new Error('褰撲簨浜鸿韩浠借瘉鍙风爜涓嶈兘涓虹┖'));
+            }
+        }
+        const checkName = (rule, value, callback) => {
+            if (value) {
+                callback();
+            } else {
+                callback(new Error('褰撲簨浜哄鍚嶄笉鑳戒负绌�'));
+            }
+        }
+        const checkPhone = (rule, value, callback) => {
+            if (value) {
+                callback();
+            } else {
+                callback(new Error('褰撲簨浜鸿仈绯荤數璇濅笉鑳戒负绌�'));
+            }
+        }
+        const checkPosition = (rule, value, callback) => {
+            if (value) {
+                callback();
+            } else {
+                callback(new Error('杩濇硶寤鸿鍏蜂綋浣嶇疆涓嶈兘涓虹┖'));
+            }
+        }
+        const checkPositive = (rule, value, callback) => {
+            if (value) {
+                if (this.ill.negative === '') {
+                    callback('韬唤璇佸弽闈笉鑳戒负绌�');
+                } else {
+                    callback();
+                }
+            } else {
+                callback(new Error('韬唤璇佹闈笉鑳戒负绌�'));
+
+            }
+        }
+        const checkSite = (rule, value, callback) => {
+            if (value) {
+                callback();
+            } else {
+                callback(new Error('杩濇硶寤鸿鍦扮偣涓嶈兘涓虹┖'));
+            }
+        }
+        const checkDate = (rule, value, callback) => {
+            if (value) {
+                callback();
+            } else {
+                callback(new Error('鎶ヨ鏃堕棿涓嶈兘涓虹┖'))
+            }
+        }
         return {
-            role: {
-                name: '',
-                type: '',
-                description: '',
+            ill: {
+                buildingArea: 2.0,
+                buildingHigh: 2.0,
+                buildingLength: 2.0,
+                buildingWidth: 1.0,
+                // category: '',
+                categoryId: '',
+                communityId: '',
+                materials: "閽㈢瓔",
+                partyIdCard: "511025184612310213",
+                partyName: "鍗曟暟澶�",
+                partyPhone: "17844631885",
+                position: "鏂板湴鏂规柊浣庣偣",
+                positive: "",
+                negative: "",
+                site: "鏂板湴鏂�",
+                alarmTime: '',
             },
-            createRoleRules: {
-                name: [
-                    { required: true, trigger: "blur", validator: validateNickname },
+            createillRules: {
+                buildingArea: [
+                    {
+                        required: true, trigger: 'change', validator: checkArea
+                    }
                 ],
-                type: [
-                    { required: false, trigger: "blur", validator: validatePass },
+                buildingHigh: [
+                    {
+                        required: true, trigger: 'blur', validator: checkHigh
+                    }
                 ],
-                description: [
-                    { required: false, trigger: "blur", validator: validateTruename },
+                buildingLength: [
+                    {
+                        required: true, trigger: 'blur', validator: checkLength
+                    }
                 ],
+                buildingWidth: [
+                    {
+                        required: true, trigger: 'blur', validator: checkWidth
+                    }
+                ],
+                categoryId: [
+                    {
+                        required: true, trigger: 'change', validator: checkCategoryId
+                    }
+                ],
+                communityId: [
+                    {
+                        required: true, trigger: 'change', validator: checkCommunityId
+                    }
+                ],
+                materials: [
+                    {
+                        required: true, trigger: 'blur', validator: checkMaterials
+                    }
+                ],
+                partyIdCard: [
+                    {
+                        required: true, trigger: 'blur', validator: checkIdCard
+                    }
+                ],
+                partyName: [
+                    {
+                        required: true, trigger: 'blur', validator: checkName
+                    }
+                ],
+                partyPhone: [
+                    {
+                        required: true, trigger: 'blur', validator: checkPhone
+                    }
+                ],
+                position: [
+                    {
+                        required: true, trigger: 'blur', validator: checkPosition
+                    }
+                ],
+                positive: [
+                    {
+                        required: true, trigger: 'change', validator: checkPositive
+                    }
+                ],
+                site: [
+                    {
+                        required: true, trigger: 'blur', validator: checkSite
+                    }
+                ],
+                alarmTime: [
+                    {
+                        required: true, trigger: 'change', validator: checkDate
+                    }
+                ]
             },
             bigKindList: [],
-            typeList: [],
+            typeList: [
+                {
+                    name: '绀惧尯1',
+                    value: 1,
+                },
+                {
+                    name: '绀惧尯2',
+                    value: 2,
+                }
+            ],
         }
     },
     created() {
-        const { getBigKind, getEventLevel, getSmallKind } = this;
+        const { getBigKind } = this;
+        // this.ill.category = this.mytype + 1;
         getBigKind();
     },
     methods: {
         handleUser() {
-            this.$refs['user'].validate((valid) => {
-                console.log(valid);
+            const that = this;
+            // console.log(this.$refs);
+            this.$refs.user.validate((valid) => {
+                console.log(valid)
                 if (valid) {
-                    const { role } = this;
-                    console.log(role);
-                    this.$axios.post('sccg/role/create', {
-                        description: role.description, name: role.name, type: role.type
-                    }).then(res => {
-                        if (res.code === 200) {
-                            this.refresh();
+                    that.$refs.condition.validate((flag) => {
+                        console.log(flag);
+                        if (flag) {
+                            const { ill } = this;
+                            ill.buildingLength = parseFloat(ill.buildingLength);
+                            ill.buildingHigh = parseFloat(ill.buildingHigh);
+                            ill.buildingWidth = parseFloat(ill.buildingWidth);
+                            ill.buildingArea = parseFloat(ill.buildingArea);
+                            console.log(ill);
+                            that.$axios({
+                                method: 'post',
+                                url: 'sccg/base-case/addition_illegal_building',
+                                data: ill,
+                            })
+                                .then(res => {
+                                    if (res.code === 200) {
+                                        this.$message({
+                                            type: 'success',
+                                            message: res.message
+                                        })
+                                        this.$emit('changeDialog', { dialogView: false });
+                                    } else {
+                                        this.$message({
+                                            type: 'warning',
+                                            message: res.message,
+                                        })
+                                    }
+                                })
+                        } else {
+                            return false;
                         }
                     })
                 } else {
@@ -205,13 +400,26 @@
             if (token && tokenHead) {
                 return { Authorization: tokenHead + token };
             }
+        },
+        handleSuccess(res, file, filelist) {
+            const baseUrl = 'http://140.143.152.226:8410/';
+            console.log(res);
+            this.ill.positive = baseUrl + res.data.url1;
+
+        },
+        handleSuccess2(res, file, filelist) {
+            const baseUrl = 'http://140.143.152.226:8410/';
+            console.log(res);
+            this.ill.negative = baseUrl + res.data.url1;
         }
-    }
+    },
+    props: ['mytype', 'changeDialog']
 }
 </script>
 <style lang="scss" scoped>
 .ill {
     display: flex;
+    padding: 20px 50px;
 
     .input-area {
         flex: 1;
@@ -242,14 +450,17 @@
                 background-color: #09152f;
                 border: 1px solid #17324c;
             }
-            .upload-demo{
+
+            .upload-demo {
                 position: relative;
-                .text{
+
+                .text {
                     position: absolute;
                     top: 22%;
                     left: 20%;
                 }
             }
+
             .idcard {
                 display: flex;
             }
@@ -266,38 +477,17 @@
         }
     }
 
-    .map-area {
-        flex: 1;
+    .img {
+        width: 125px;
+        height: 80px;
     }
 
-    .not-need {
-        .not-need__header {
-            line-height: 40px;
-        }
+    .area {
+        display: flex;
+    }
 
-        .not-need-item {
-            line-height: 40px;
-            margin-bottom: 22px;
-            display: flex;
-
-            label {
-                width: 160px;
-                padding-right: 12px;
-                text-align: right;
-            }
-
-            .not-need__inner {
-                flex: 1;
-                line-height: 40px;
-                padding: 0 15px;
-                border-radius: 4px;
-                color: #fff;
-                // outline: #409eff solid 1px;
-                outline: none;
-                background-color: #09152f;
-                border: 1px solid #17324c;
-            }
-        }
+    .map-area {
+        flex: 1;
     }
 }
 </style>
\ No newline at end of file

--
Gitblit v1.8.0