| | |
| | | <!-- 问题类型 --> |
| | | <el-form-item class="optionItem" label="问题类型:" prop="category"> |
| | | <el-select v-model="ill.type" placeholder="违建" disabled> |
| | | <el-option v-for="item in typeList" :key="item.name" :label="item.name" |
| | | <el-option v-for="item in communityList" :key="item.name" :label="item.name" |
| | | :value="item.value" :disabled="item.disabled"> |
| | | </el-option> |
| | | </el-select> |
| | |
| | | <el-form-item class="optionItems" label="违建地点:" prop="site"> |
| | | <el-input placeholder="请填写违建地点" v-model="ill.site"></el-input> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="user-item"> |
| | | <!-- 所属街道 --> |
| | | <el-form-item class="optionItems" label="所属街道:" prop="streetId"> |
| | | <el-select v-model="ill.streetId" placeholder="请选择所属街道" @change="handleStreet"> |
| | | <el-option v-for="item in streetList" :key="item.id" :label="item.regionName" :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <!-- 所属社区 --> |
| | | <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 v-for="item in communityList" :key="item.id" :label="item.regionName" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </div> |
| | | <!-- 身份证正反面照片 --> |
| | | <el-form-item class="optionItems" label="身份证正反面照片:" prop="positive"> |
| | | <el-form-item class="optionItems" label="身份证正、反面照片:" prop="positive"> |
| | | <template> |
| | | <div class="idcard"> |
| | | <el-upload class="upload-demo" :show-file-list="false" |
| | |
| | | </template> |
| | | <script> |
| | | import MyMap from '@/components/map' |
| | | import {parseTime} from '@/utils/index' |
| | | import { validateName, validatePhone, validateCardId, validateNum } from '@/utils/validate' |
| | | export default { |
| | | components: { |
| | |
| | | callback(new Error('报警时间不能为空')) |
| | | } |
| | | } |
| | | const checkStreet=(rule, value, callback) => { |
| | | if (value) { |
| | | callback(); |
| | | } else { |
| | | callback(new Error('所属街道不能为空')) |
| | | } |
| | | } |
| | | return { |
| | | ill: { |
| | | buildingArea: '', |
| | |
| | | { |
| | | required: true, trigger: 'change', validator: checkDate |
| | | } |
| | | ] |
| | | ], |
| | | streetId: [ |
| | | { |
| | | required: true, trigger: 'change', validator: checkStreet |
| | | } |
| | | ], |
| | | }, |
| | | bigKindList: [], |
| | | typeList: [ |
| | | { |
| | | name: '社区1', |
| | | value: 1, |
| | | }, |
| | | { |
| | | name: '社区2', |
| | | value: 2, |
| | | } |
| | | communityList: [ |
| | | ], |
| | | streetList: [], |
| | | } |
| | | }, |
| | | created() { |
| | | const { getBigKind, getCommityList } = this; |
| | | const { getBigKind, getCommityList,getStreetList } = this; |
| | | getStreetList(0); |
| | | |
| | | // this.ill.category = this.mytype + 1; |
| | | getBigKind(); |
| | | getCommityList(); |
| | |
| | | methods: { |
| | | handleUser() { |
| | | const that = this; |
| | | // console.log(this.$refs); |
| | | this.$refs.user.validate((valid) => { |
| | | console.log(valid) |
| | | if (valid) { |
| | | 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, |
| | | data: { |
| | | ...ill, |
| | | alarmTime:parseTime(ill.alarmTime) |
| | | }, |
| | | }) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | |
| | | url: 'sccg/illegal_building/query/type_second' |
| | | }).then(res => { |
| | | this.bigKindList = res.data; |
| | | // console.log(res); |
| | | }) |
| | | }, |
| | | // 获取token |
| | |
| | | }, |
| | | handleSuccess(res, file, filelist) { |
| | | const baseUrl = 'http://140.143.152.226:8410/'; |
| | | // if(res.code === 500){ |
| | | // console.log('err'); |
| | | // return; |
| | | // } |
| | | 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; |
| | | }, |
| | | // 查询社区 |
| | |
| | | url: 'sccg/dict/query_type?level=1&typeCode=' + '10' |
| | | }) |
| | | .then(res => { |
| | | console.log(res); |
| | | }) |
| | | }, |
| | | // 获取街道信息 |
| | | async getStreetList(id) { |
| | | let arr |
| | | await this.$axios({ |
| | | method:'get', |
| | | url:`sccg/sccg_region/getChildren/${id}`, |
| | | }) |
| | | .then(res=>{ |
| | | if(res.code === 200){ |
| | | arr = res.data; |
| | | } |
| | | }) |
| | | this.streetList = arr; |
| | | }, |
| | | // 街道更改 |
| | | handleStreet(id) { |
| | | this.ill.communityId = ''; |
| | | this.$axios({ |
| | | method: 'get', |
| | | url: `sccg/sccg_region/getChildren/${id}` |
| | | }) |
| | | .then(res => { |
| | | this.communityList = res.data; |
| | | }) |
| | | }, |
| | | handleBack(){ |
| | |
| | | <style lang="scss" scoped> |
| | | .ill { |
| | | display: flex; |
| | | padding: 20px 50px; |
| | | padding: 20px 10px 50px; |
| | | |
| | | .user-item { |
| | | display: flex; |
| | |
| | | } |
| | | } |
| | | .el-form { |
| | | &::v-deep .el-form-item__label { |
| | | color: #4b9bb7; |
| | | } |
| | | // &::v-deep .el-form-item__label { |
| | | // color: #4b9bb7; |
| | | // } |
| | | |
| | | &::v-deep .el-input__inner { |
| | | background-color: #09152f; |
| | | border: 1px solid #17324c; |
| | | } |
| | | // &::v-deep .el-input__inner { |
| | | // // background-color: #09152f; |
| | | // border: 1px solid #17324c; |
| | | // } |
| | | |
| | | &::v-deep .el-textarea__inner { |
| | | background-color: #09152f; |
| | | border: 1px solid #17324c; |
| | | } |
| | | // &::v-deep .el-textarea__inner { |
| | | // // background-color: #09152f; |
| | | // border: 1px solid #17324c; |
| | | // } |
| | | } |
| | | .input-form { |
| | | |
| | | |
| | | .upload-demo { |
| | | position: relative; |
| | | |
| | | margin-right: 20px; |
| | | .text { |
| | | position: absolute; |
| | | top: 22%; |