<template>
|
<view class="container">
|
<view class="wrap">
|
<u-form labelWidth="70" :model="form" :rules="rules" ref="form">
|
<view class="item">
|
<!-- u-form-item v-if="!currentId" @click="showPicker = true" class="form-item" labelWidth="100" label="楼栋:"
|
:required="isRequired" :disabled="isDisabled" prop="buildingCode">
|
<u--input border="none" disabledColor="#ffffff" v-model="form.building" placeholder="请选择">
|
</u--input>
|
<u-icon slot="right" name="arrow-right"></u-icon>
|
</u-form-item> -->
|
<view class="box-title">
|
<box-title title="基础信息"></box-title>
|
</view>
|
<u-form-item class="form-item" labelWidth="100" label="场所名称:" :required="isRequiredPlace"
|
:disabled="isDisabled" prop="placeName">
|
<u--input border="none" v-model="form.placeName" placeholder="请输入">
|
</u--input>
|
</u-form-item>
|
|
<u-form-item @click="popup" class="form-item" labelWidth="100" label="标签:" :required="isRequired"
|
:disabled="isDisabled" prop="label">
|
<u-input border="none" v-model="categoryValue" disabled disabledColor="#ffffff"
|
placeholder="请选择">
|
</u-input>
|
<u-icon slot="right" name="arrow-right"></u-icon>
|
</u-form-item>
|
<u-form-item label="九小场所:" labelWidth="100" prop="isNine" :required="isRequired">
|
<u-radio-group v-model="form.isNine">
|
<u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in statusList"
|
:key="index" :label="item.name" :name="item.id">
|
</u-radio>
|
</u-radio-group>
|
<!-- <view class="f-30" v-if="currentId">
|
{{form.isNine == 1?"是":"否"}}
|
</view> -->
|
</u-form-item>
|
<u-form-item v-if="form.isNine == 1" @click="showNineTypeSelector" class="form-item"
|
labelWidth="100" label="九小场所类型:" :required="isRequired" :disabled="isDisabled" prop="nineType">
|
<u-input border="none" v-model="nineTypeValue" disabled disabledColor="#ffffff"
|
placeholder="请选择">
|
</u-input>
|
<u-icon slot="right" name="arrow-right"></u-icon>
|
</u-form-item>
|
<u-form-item label="阵地:" labelWidth="100" prop="isFront" :required="isRequired">
|
<u-radio-group v-model="form.isFront">
|
<u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in statusList"
|
:key="index" :label="item.name" :name="item.id">
|
</u-radio>
|
</u-radio-group>
|
<!-- <view class="f-30" v-if="currentId">
|
{{form.isFront == 1?"是":"否"}}
|
</view> -->
|
</u-form-item>
|
<u-form-item v-if="form.isFront == 1" @click="showFrontTypePicker = true" class="form-item"
|
labelWidth="100" label="阵地类型:" :required="isRequired" :disabled="isDisabled" prop="frontType">
|
<u-input border="none" v-model="frontTypeValue" disabled disabledColor="#ffffff"
|
placeholder="请选择">
|
</u-input>
|
<u-icon slot="right" name="arrow-right"></u-icon>
|
</u-form-item>
|
<!-- <view v-if="showLabelList.length" class="label" style="border-bottom:1px solid eff1f3;">
|
<view v-for="(item,index) in showLabelList" :key="index" class="activeLabel">
|
<u-tag :closable="currentId?false:true" :show="!item.isClose" size="mini"
|
@close="delTag(item)" :text="item.text"></u-tag>
|
</view>
|
</view> -->
|
<!-- <view v-if="categoryValue.length" class="label" style="border-bottom:1px solid eff1f3;">
|
<view v-for="(item,index) in categoryValue" :key="index" class="activeLabel">
|
<u-tag :closable="currentId?false:true" size="mini"
|
@close="delTag()" :text="item.categoryName"></u-tag>
|
</view>
|
</view> -->
|
|
<u-form-item label="三级消防单位" labelWidth="100" prop="threeFireProtection" :required="isRequired">
|
<u-radio-group v-model="form.threeFireProtection">
|
<u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in statusList"
|
:key="index" :label="item.name" :name="item.id">
|
</u-radio>
|
</u-radio-group>
|
|
</u-form-item>
|
<u-form-item class="form-item" labelWidth="100" label="无诈类别:" :required="isRequired"
|
:disabled="isDisabled" prop="noExplosionCategory">
|
<view class="flex j-c-s-b a-i-c" @click="showNotSwindleTypePicker= true">
|
<u-input border="none" v-model="notSwindleValue" disabled disabledColor="#ffffff"
|
placeholder="请选择">
|
</u-input>
|
<u-icon slot="right" name="arrow-right"></u-icon>
|
</view>
|
</u-form-item>
|
<u-form-item class="form-item" labelWidth="100" label="备注:" prop="remark">
|
<u--input border="none" v-model="form.remark" placeholder="请输入">
|
</u--input>
|
</u-form-item>
|
|
|
<u-form-item label="经纬度:" prop="location" labelWidth="100">
|
<view class="address-row flex j-c-s-b a-i-c">
|
<view class="address-content f-28" v-if="form.jwd">
|
{{form.jwd}}
|
</view>
|
<view class="address-content f-28" v-if="!form.jwd" style="color: #c0c4cc;">
|
请选择地址
|
</view>
|
<view class="location-btn c-main f-24" @click="getLocation()">
|
获取地址
|
</view>
|
</view>
|
</u-form-item>
|
|
<u-form-item label="地址:" labelWidth="100" v-if="form.location">
|
<view class="address-row">
|
{{form.location}}
|
</view>
|
</u-form-item>
|
|
</view>
|
|
<view class="item">
|
<view class="flex j-c-s-b a-i-c">
|
<view class="box-title" style="width:50%;">
|
<box-title title="负责人信息"></box-title>
|
</view>
|
<!-- #ifdef MP-WEIXIN -->
|
<ocr-navigator @onSuccess="recognizeSuccess($event,'principal')" certificateType="idCard"
|
:opposite="false">
|
<view class="recognize-btn flex a-i-c">
|
<u-icon name="scan" color="#fff" size="24"></u-icon>
|
<text class="f-26 c-ff" style="margin-left: 10rpx;">身份证信息识别</text>
|
</view>
|
</ocr-navigator>
|
<!-- #endif -->
|
</view>
|
<u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
|
label="场所负责人:" prop="principal">
|
<u--input border="none" v-model="form.principal" placeholder="请输入">
|
</u--input>
|
</u-form-item>
|
<u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
|
label="手机号:" prop="principalPhone">
|
<u--input border="none" type="number" v-model="form.principalPhone" placeholder="请输入">
|
</u--input>
|
</u-form-item>
|
<u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
|
label="身份证号:" prop="principalIdCard">
|
<u--input border="none" type="idcard" v-model="form.principalIdCard" placeholder="请输入">
|
</u--input>
|
</u-form-item>
|
</view>
|
|
|
<view class="item">
|
<view class="flex j-c-s-b a-i-c">
|
<view class="box-title" style="width:50%;">
|
<box-title title="法人信息"></box-title>
|
</view>
|
<!-- #ifdef MP-WEIXIN -->
|
<ocr-navigator @onSuccess="recognizeSuccess($event,'legal')" certificateType="idCard"
|
:opposite="false">
|
<view class="recognize-btn flex a-i-c">
|
<u-icon name="scan" color="#fff" size="24"></u-icon>
|
<text class="f-26 c-ff" style="margin-left: 10rpx;">身份证信息识别</text>
|
</view>
|
</ocr-navigator>
|
<!-- #endif -->
|
</view>
|
<u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
|
label="姓名:" prop="legalPerson">
|
<u--input border="none" v-model="form.placeExtEntity.legalPerson" placeholder="请输入">
|
</u--input>
|
</u-form-item>
|
<u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
|
label="身份证号:" prop="legalIdCard">
|
<u--input border="none" type="idcard" v-model="form.placeExtEntity.legalIdCard"
|
placeholder="请输入">
|
</u--input>
|
</u-form-item>
|
|
<u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
|
label="手机号:" prop="legalTel">
|
<u--input border="none" type="number" v-model="form.placeExtEntity.legalTel" placeholder="请输入">
|
</u--input>
|
</u-form-item>
|
</view>
|
|
|
|
<view class="item">
|
<view class="flex j-c-s-b a-i-c">
|
<view class="box-title" style="width:50%;">
|
<box-title title="房东信息"></box-title>
|
</view>
|
<!-- #ifdef MP-WEIXIN -->
|
<ocr-navigator @onSuccess="recognizeSuccess($event)" certificateType="idCard" :opposite="false">
|
<view class="recognize-btn flex a-i-c">
|
<u-icon name="scan" color="#fff" size="24"></u-icon>
|
<text class="f-26 c-ff" style="margin-left: 10rpx;">身份证信息识别</text>
|
</view>
|
</ocr-navigator>
|
<!-- #endif -->
|
</view>
|
<u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
|
label="姓名:" prop="landlordName">
|
<u--input border="none" v-model="form.placeExtEntity.landlordName" placeholder="请输入">
|
</u--input>
|
</u-form-item>
|
<u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
|
label="身份证号:" prop="landlordIdCard">
|
<u--input border="none" type="idcard" v-model="form.placeExtEntity.landlordIdCard"
|
placeholder="请输入">
|
</u--input>
|
</u-form-item>
|
<u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
|
label="手机号:" prop="landlordPhone">
|
<u--input border="none" type="number" v-model="form.placeExtEntity.landlordPhone"
|
placeholder="请输入">
|
</u--input>
|
</u-form-item>
|
<u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
|
label="微信号:" prop="landlordWxAccount">
|
<u--input border="none" v-model="form.placeExtEntity.landlordWxAccount" placeholder="请输入">
|
</u--input>
|
</u-form-item>
|
</view>
|
|
<view class="item" v-if="form.label == 160102 || form.label == 160103">
|
<view class="flex j-c-s-b a-i-c">
|
<view class="box-title" style="width:50%;">
|
<box-title title="学校信息"></box-title>
|
</view>
|
</view>
|
<u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
|
label="学生人数:" prop="studentNumber">
|
<u--input border="none" type="number" v-model="form.placeExtEntity.studentNumber"
|
placeholder="请输入">
|
</u--input>
|
</u-form-item>
|
<u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
|
label="教职工人数:" prop="workersNumber">
|
<u--input border="none" type="number" v-model="form.placeExtEntity.workersNumber"
|
placeholder="请输入">
|
</u--input>
|
</u-form-item>
|
<u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
|
label="专职保安:" prop="securityNumber">
|
<u--input border="none" type="number" v-model="form.placeExtEntity.securityNumber"
|
placeholder="请输入">
|
</u--input>
|
</u-form-item>
|
<u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
|
label="专职门卫:" prop="guardNumber">
|
<u--input border="none" type="number" v-model="form.placeExtEntity.guardNumber"
|
placeholder="请输入">
|
</u--input>
|
</u-form-item>
|
<u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
|
label="专兼职保卫人员:" prop="temporarySecurityNumber">
|
<u--input border="none" type="number" v-model="form.placeExtEntity.temporarySecurityNumber"
|
placeholder="请输入">
|
</u--input>
|
</u-form-item>
|
<u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
|
label="走读/寄宿:" prop="dayStudentsNumber">
|
<u--input border="none" type="number" v-model="form.placeExtEntity.dayStudentsNumber"
|
placeholder="请输入">
|
</u--input>
|
</u-form-item>
|
<u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
|
label="住校生人数:" prop="residentialStudentsNumber">
|
<u--input border="none" type="number" v-model="form.placeExtEntity.residentialStudentsNumber"
|
placeholder="请输入">
|
</u--input>
|
</u-form-item>
|
<u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
|
label="宿舍管理人员:" prop="housemasterNumber">
|
<u--input border="none" type="number" v-model="form.placeExtEntity.housemasterNumber"
|
placeholder="请输入">
|
</u--input>
|
</u-form-item>
|
</view>
|
|
|
<view class="item pic">
|
<view class="box-title">
|
<box-title title="场所照片"></box-title>
|
</view>
|
<u-upload :fileList="form.images" :previewFullImage="uploadConfig.previewFullImage"
|
:accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple"
|
:maxCount="uploadConfig.maxCount" :capture="uploadConfig.capture"
|
uploadIcon="/static/icon/upload.png" @afterRead="afterReadImg" @delete="deletePic">
|
</u-upload>
|
</view>
|
</u-form>
|
|
<view class="practitioner">
|
<view style="padding:20rpx 30rpx;">
|
<box-title title="从业人员信息"></box-title>
|
</view>
|
<view class="info" v-for="(item, index) in personNumArr" :key="index">
|
<view class="flex a-i-c j-c-s-b" style="padding:20rpx;">
|
<view class="flex j-c-s-b a-i-c">
|
<view class="title fw" style="text-align:center; mr-20">人员信息-#{{ index*1 + 1 }}</view>
|
<!-- #ifdef MP-WEIXIN -->
|
<ocr-navigator @onSuccess="recognizePersonSuccess($event,index)" certificateType="idCard"
|
:opposite="false">
|
<view class="recognize-btn flex a-i-c">
|
<u-icon name="scan" color="#fff" size="24"></u-icon>
|
<text class="f-26 c-ff" style="margin-left: 10rpx;">身份证信息识别</text>
|
</view>
|
</ocr-navigator>
|
<!-- #endif-->
|
</view>
|
<view>
|
<u-icon name="trash-fill" color="#ff0000" size="20" @click="deletePerson(index)" />
|
</view>
|
</view>
|
<formItem ref="formItemRef"></formItem>
|
</view>
|
|
<view class="add-person" style="padding:20rpx 30rpx;">
|
<u-button type="success" plain @click="addPerson">再加一人</u-button>
|
</view>
|
</view>
|
|
|
|
<view class="item" v-if="currentId">
|
<view class="box-title">
|
<box-title title="综治网格">
|
<template slot="titleMore">
|
<view class="title-more">
|
<view class="red item"></view>
|
<view class="orange item"></view>
|
<view class="green item"></view>
|
</view>
|
</template>
|
</box-title>
|
</view>
|
<lineItem :dataInfo="comprehensiveData.basic">
|
</lineItem>
|
<!-- <view class="bgc-ff flex j-c-s-b a-i-c" @click="navTo(1)" style="padding:20rpx;">
|
<text>历史事件</text>
|
<u-icon name="arrow-right"></u-icon>
|
</view> -->
|
|
<lineItem :dataInfo="comprehensiveData.scene">
|
<template v-slot:pic="{scope}">
|
<view class="image" v-if="scope.value !== ''">
|
<u--image @click="imgPreview(scope.value)" width="200rpx" height="200rpx"
|
:src="scope.value"></u--image>
|
</view>
|
<view class="" v-else>
|
{{scope.value}}
|
</view>
|
</template>
|
</lineItem>
|
</view>
|
|
|
|
<view class="item" v-if="currentId">
|
<view class="box-title">
|
<box-title title="公安网格">
|
<template slot="titleMore">
|
<view class="title-more">
|
<view class="red item"></view>
|
<view class="orange item"></view>
|
<view class="green item"></view>
|
</view>
|
</template>
|
</box-title>
|
</view>
|
<lineItem :dataInfo="publicData.basic">
|
</lineItem>
|
<!-- <view class="bgc-ff flex j-c-s-b a-i-c" @click="navTo(2)" style="padding:20rpx;">
|
<text>历史事件</text>
|
<u-icon name="arrow-right"></u-icon>
|
</view> -->
|
|
<lineItem :dataInfo="publicData.scene">
|
<template v-slot:pic="{scope}">
|
{{scope.value}}
|
</template>
|
</lineItem>
|
</view>
|
</view>
|
<footer-btn @click="submit" text="保存" />
|
|
<u-picker :show="showNineTypePicker" :defaultIndex="nineTypeIndex" ref="uPicker" keyName="name"
|
:loading="pickerLoading" :columns="[nineTypeList]" @confirm="confirmNineTypePicker"
|
@cancel="showNineTypePicker = false"></u-picker>
|
|
<!-- <u-picker :show="showPicker" :defaultIndex="defaultIndex" ref="uPicker" keyName="name" :loading="pickerLoading"
|
:columns="pickColumns" @change="changeHandler" @confirm="confirmPicker"
|
@cancel="showPicker = false"></u-picker> -->
|
|
<u-picker :show="showFrontTypePicker" :defaultIndex="frontTypeIndex" ref="uPicker" keyName="name"
|
:loading="pickerLoading" :columns="[frontTypeList]" @confirm="confirmFrontTypePicker"
|
@cancel="showFrontTypePicker = false"></u-picker>
|
|
<u-picker :show="isShowCatePicker" :defaultIndex="categoryIndex" ref="catePicker" keyName="categoryName"
|
:columns="categoryList" @confirm="confirmCategory" @change="changeCategory"
|
@cancel="isShowCatePicker = false"></u-picker>
|
|
|
<u-picker :defaultIndex="nationTypeListIndex" :closeOnClickOverlay="true" :show="showNationPicker"
|
:columns="[nationTypeList]" @close="showNationPicker = false" @cancel="showNationPicker = false"
|
keyName="name" @confirm="confirmNation"></u-picker>
|
|
<u-picker :defaultIndex="genderIndex" :closeOnClickOverlay="true" :show="showGenderPicker" :columns="[gender]"
|
@close="showGenderPicker = false" @cancel="showGenderPicker = false" keyName="name"
|
@confirm="confirmGender"></u-picker>
|
|
<u-picker :defaultIndex="notSwindleTypeIndex" :closeOnClickOverlay="true" :show="showNotSwindleTypePicker"
|
:columns="[notSwindleTypeList]" @close="showNotSwindleTypePicker = false"
|
@cancel="showNotSwindleTypePicker = false" keyName="name" @confirm="confirmNotSwindleType"></u-picker>
|
|
<cate-selector ref="selector" @comfirm="comfirmNineType" />
|
</view>
|
</template>
|
|
<script>
|
import uploadMixin from "@/mixin/uploadMixinPlace";
|
import lineItem from "@/subPackage/workbench/components/lineItem.vue"
|
import {
|
getLabelCate
|
} from "@/api/label/categoryLabel.js";
|
import {
|
getDoorplateAddressDetail,
|
getDoorplateAddressList
|
} from "@/api/doorplateAddress/doorplateAddress";
|
import {
|
add,
|
getPlaceDetail
|
} from "@/api/place/place";
|
import {
|
format
|
} from "echarts";
|
import boxTitle from '../components/boxTitle/index.vue'
|
import {
|
minioBaseUrl
|
} from "../../../common/setting";
|
import {
|
bizDictionary,
|
bizDictionaryTree
|
} from '@/api/system/dict.js'
|
|
import cateSelector from "../components/cateSelector.vue"
|
|
import {
|
getQrCodeDetail
|
} from "@/api/system/index"
|
|
import formItem from '../components/formItem.vue'
|
export default {
|
mixins: [uploadMixin],
|
components: {
|
lineItem,
|
boxTitle,
|
cateSelector,
|
formItem
|
},
|
data() {
|
return {
|
isRequired: false,
|
isRequiredPlace: true,
|
isDisabled: true,
|
showPicker: false,
|
pickerLoading: false,
|
pickColumns: [],
|
defaultIndex: [0, 0, 0, 0, 0],
|
|
selectValue: [],
|
|
form: {
|
// buildingCode: "",
|
images: [],
|
label: "",
|
remark: "",
|
imageUrls: "",
|
placeName: "",
|
principal: '',
|
principalPhone: '',
|
principalIdCard: '',
|
lat: '',
|
lng: '',
|
location: '',
|
isNine: "",
|
isFront: "",
|
frontType: "",
|
nineType: "",
|
threeFireProtection: "",
|
noExplosionCategory: "",
|
placeExtEntity: {
|
landlordName: "",
|
landlordIdCard: "",
|
landlordPhone: "",
|
landlordWxAccount: "",
|
legalPerson: "",
|
legalTel: "",
|
legalIdCard: "",
|
placeId: "",
|
|
studentNumber: "",
|
workersNumber: "",
|
securityNumber: "",
|
guardNumber: "",
|
temporarySecurityNumber: "",
|
dayStudentsNumber: "",
|
residentialStudentsNumber: "",
|
housemasterNumber: ""
|
|
}
|
},
|
rules: {
|
// 'buildingCode': {
|
// type: 'string',
|
// required: true,
|
// message: '请选择楼栋',
|
// trigger: ['blur', 'change']
|
// },
|
'form.isNine': {
|
type: 'string',
|
required: true,
|
message: '是否九小场所',
|
trigger: ['blur', 'change']
|
},
|
'form.placeName': {
|
type: 'string',
|
required: true,
|
message: '请输入场所名称',
|
trigger: ['blur', 'change']
|
},
|
'form.label': {
|
type: 'string',
|
required: true,
|
message: '请选择标签',
|
trigger: ['blur', 'change'],
|
},
|
'form.username': {
|
type: 'string',
|
required: true,
|
message: '请输入场所负责人',
|
trigger: ['blur', 'change'],
|
},
|
'form.principalPhone': [{
|
required: false,
|
message: '请输入手机号',
|
trigger: ['blur', 'change'],
|
},
|
{
|
validator: (rule, value, callback) => {
|
return uni.$u.test.mobile(value);
|
},
|
message: '手机号码不正确',
|
trigger: ['change', 'blur']
|
|
}
|
],
|
'form.principalIdCard': [{
|
type: 'string',
|
required: false,
|
message: '请输入身份证号码',
|
trigger: ['change', 'blur']
|
},
|
{
|
validator: (rule, value, callback) => {
|
const idCardRegex =
|
/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/
|
return idCardRegex.test(value)
|
},
|
message: '身份证号码有误',
|
trigger: ['change', 'blur']
|
}
|
],
|
},
|
|
labelList: [{
|
text: '全部标签',
|
children: [],
|
dot: false
|
}, ],
|
|
comprehensiveData: {
|
basic: [{
|
label: "社区名称",
|
name: 'communityName',
|
value: "暂无数据"
|
},
|
{
|
label: "网格名称",
|
name: 'gridName',
|
value: "暂无数据"
|
},
|
{
|
label: "网格员",
|
name: 'realName',
|
value: "暂无数据"
|
},
|
{
|
label: "联系电话",
|
name: 'gridPhone',
|
value: "暂无数据"
|
}
|
],
|
scene: [
|
// {
|
// label: "场所照片",
|
// name: 'imageUrls',
|
// value: "",
|
// useSlot: "pic",
|
// },
|
// {
|
// label: "场所负责人",
|
// name: 'username',
|
// value: "未完善",
|
// },
|
// {
|
// label: "采集人",
|
// name: 'createUserName',
|
// value: "未完善"
|
// },
|
// {
|
// label: "采集时间",
|
// name: 'createTime',
|
// value: "未完善"
|
// },
|
// {
|
// label: "历史事件",
|
// value: "未完善",
|
// }
|
],
|
},
|
publicData: {
|
basic: [{
|
label: "公安局",
|
name: 'branchName',
|
value: "暂无数据"
|
},
|
{
|
label: "派出所",
|
name: 'localPoliceStationName',
|
value: "暂无数据"
|
},
|
{
|
label: "辖区民警",
|
name: 'policeman',
|
value: "暂无数据"
|
},
|
{
|
label: "联系电话",
|
name: 'policemanPhone',
|
value: "暂无数据"
|
}
|
],
|
scene: [
|
|
// {
|
// label: "消防照片",
|
// useSlot: "pic",
|
// },
|
// {
|
// label: "采集人",
|
// value: "未完善"
|
// },
|
// {
|
// label: "采集时间",
|
// value: "未完善"
|
// },
|
// {
|
// label: "消防负责人",
|
// value: "未完善",
|
// },
|
// {
|
// label: "采集人",
|
// value: "未完善"
|
// },
|
// {
|
// label: "采集时间",
|
// value: "未完善",
|
// },
|
// {
|
// label: "历史事件",
|
// value: "未完善",
|
// }
|
],
|
},
|
|
activeIds: [],
|
showLabelList: [],
|
houseCode: "",
|
currentId: "",
|
addressType: 2,
|
isShowCatePicker: false,
|
categoryList: [
|
[],
|
[]
|
],
|
categoryIndex: [],
|
firstId: "",
|
secondId: "",
|
categoryValue: "",
|
houseCode: "",
|
statusList: [{
|
name: "是",
|
id: 1
|
},
|
{
|
name: "否",
|
id: 2
|
}
|
],
|
nineTypeList: [], //九小类型
|
frontTypeList: [], //阵地
|
nineTypeIndex: [0],
|
frontTypeIndex: [0],
|
showNineTypePicker: false,
|
showFrontTypePicker: false,
|
nineTypeValue: "",
|
frontTypeValue: "",
|
isView: false,
|
|
nationTypeList: [], //民族
|
nationTypeIndex: [0],
|
nationValue: "",
|
gender: [{ //性别
|
value: 1,
|
name: '男',
|
},
|
{
|
value: 0,
|
name: '女',
|
}
|
],
|
genderIndex: [0],
|
genderValue: "",
|
showNationPicker: false,
|
showGenderPicker: false,
|
personNum: 0,
|
personNumArr: [],
|
notSwindleTypeList: [],
|
notSwindleIndex: [0],
|
notSwindleValue: "",
|
showNotSwindleTypePicker: false
|
}
|
},
|
options: {
|
styleIsolation: 'shared', // 解除样式隔离
|
},
|
async onLoad(option) {
|
console.log("option===>", option);
|
await this.getCategory();
|
await this.getAllBizDict();
|
// this.getNineTypeList();
|
|
const {
|
type
|
} = option
|
if (option.addressType) {
|
this.addressType = option.addressType
|
}
|
if (option.id) {
|
this.currentId = option.id;
|
}
|
if (option.houseCode) {
|
this.houseCode = option.houseCode
|
this.form.houseCode = option.houseCode
|
}
|
if (option.id || option.houseCode) {
|
this.getBuildingDetail()
|
}
|
this.getCurrentLocation();
|
// this.getCategory();
|
},
|
|
watch: {
|
|
firstId: {
|
handler(newVal, oldVal) {
|
if (newVal) {
|
this.getCategory(3, this.firstId);
|
}
|
},
|
immediate: true
|
}
|
},
|
onReady() {
|
this.$refs.form.setRules(this.rules)
|
},
|
|
methods: {
|
|
async getAllBizDict() {
|
// 获取九小场所类型
|
// await this.getBizDict('nineType', this.nineTypeList)
|
// 获取阵地
|
await this.getBizDict('frontType', this.frontTypeList)
|
// 获取民族
|
await this.getBizDict('nationType', this.nationTypeList);
|
//反诈类别
|
await this.getBizDict('noExplosionCategory', this.notSwindleTypeList);
|
},
|
|
// 获取业务字典
|
async getBizDict(code, list) {
|
const param = {
|
code: code
|
}
|
const res = await bizDictionary(param)
|
res.data.forEach(e => {
|
list.push({
|
name: e.dictValue,
|
value: Number(e.dictKey)
|
})
|
})
|
},
|
|
getNineTypeList() {
|
bizDictionaryTree({
|
code: "nineType"
|
}).then(res => {
|
console.log(res.data);
|
})
|
},
|
|
showNineTypeSelector() {
|
this.$refs.selector.open();
|
},
|
|
navTo(type) {
|
if (type == 1) {
|
uni.navigateTo({
|
url: `/subPackage/workbench/views/report?code=${this.houseCode}`
|
})
|
} else {
|
uni.navigateTo({
|
url: `/subPackage/workbench/views/audit?code=${this.houseCode}`
|
})
|
}
|
},
|
|
//获取分类
|
getCategory(level = 2, id) {
|
let params = {
|
level
|
}
|
if (level == 3) {
|
params.parentNo = id
|
}
|
getLabelCate(params).then(res => {
|
console.log(res)
|
if (res.code == 200) {
|
let index = level - 2;
|
this.$set(this.categoryList, index, res.data);
|
if (level == 2) {
|
this.firstId = res.data[0].categoryNo
|
}
|
}
|
})
|
},
|
|
//选择分类
|
confirmCategory(e) {
|
console.log("confirm=>", e)
|
let {
|
indexs,
|
value
|
} = e;
|
this.categoryIndex = indexs;
|
this.categoryValue = value[value.length - 1].categoryName;
|
this.form.label = value[value.length - 1].categoryNo;
|
this.isShowCatePicker = false;
|
},
|
|
//切换分类
|
changeCategory(e) {
|
const {
|
columnIndex,
|
value,
|
values, // values为当前变化列的数组内容
|
index,
|
// 微信小程序无法将picker实例传出来,只能通过ref操作
|
picker = this.$refs.catePicker
|
} = e
|
|
console.log("change=>", e)
|
|
// 当第一列值发生变化时,变化第二列(后一列)对应的选项
|
if (columnIndex === 0) {
|
|
this.firstId = e.value[columnIndex].categoryNo;
|
}
|
|
},
|
|
getBuildingDetail(params = {}) {
|
let idorCodeParams = {}
|
if (this.houseCode) {
|
idorCodeParams = {
|
houseCode: this.houseCode,
|
// addressType:this.addressType
|
}
|
}
|
if (this.addressType) {
|
idorCodeParams.addressType = this.addressType
|
}
|
if (this.currentId) {
|
idorCodeParams = {
|
id: this.currentId
|
}
|
}
|
uni.showLoading({
|
title: "加载中..."
|
})
|
getPlaceDetail({
|
...params,
|
...idorCodeParams
|
}).then(({
|
code,
|
data
|
}) => {
|
uni.hideLoading();
|
if (code !== 200) {
|
uni.showToast({
|
title: "数据加载失败",
|
icon: 'error'
|
})
|
return
|
}
|
const placePractitioner = data?.placePractitioner || []
|
this.personNum = placePractitioner.length
|
this.personNumArr = placePractitioner;
|
this.source = data.source;
|
// this.houseCode = data.houseCode;
|
const dpaEntity = data?.doorplateAddressEntity || {}
|
const gridEntity = data?.grid || {}
|
// this.form.buildingCode = dpaEntity?.buildingCode || ''
|
let buildingNameArr = [
|
dpaEntity?.townStreetName,
|
dpaEntity?.neiName,
|
dpaEntity?.streetRuName,
|
dpaEntity?.aoiName,
|
dpaEntity?.buildingName
|
]
|
let arr = buildingNameArr.filter(e => {
|
return e != null || e != ''
|
})
|
|
console.log("data===>", data);
|
this.form.placeName = data['placeName'] || ''
|
Object.keys(this.form).forEach(key => {
|
if (!data[key] && key != "placeExtEntity") {
|
// this.form[key] = dpaEntity[key] || '未完善'
|
this.form[key] = dpaEntity[key]
|
} else if (key == "placeExtEntity") {
|
if (data.placeExtEntity) {
|
this.form.placeExtEntity = data.placeExtEntity;
|
} else {
|
this.form.placeExtEntity = {
|
landlordName: "",
|
landlordIdCard: "",
|
landlordPhone: "",
|
landlordWxAccount: "",
|
legalPerson: "",
|
legalTel: "",
|
legalIdCard: "",
|
placeId: "",
|
}
|
}
|
} else {
|
// this.form[key] = data[key] || '未完善'
|
|
console.log(1111)
|
this.form[key] = data[key]
|
}
|
if (key === "images") {
|
// this.form[key] = data.imageUrls
|
if (data.imageUrls) {
|
this.form.images = this.$setImageUrl(data.imageUrls, 2);
|
this.uploadConfig.maxCount = this.form.images.length;
|
} else {
|
this.form.images = []
|
}
|
}
|
|
if (key == "isNine") {
|
// let {
|
// index,
|
// name
|
// } = this.$getIndex(this.nineTypeList, data.nineType, "value", "name");
|
// this.nineTypeIndex = index;
|
// this.nineTypeValue = name;
|
if (!data.isNine) {
|
this.form.isNine = 2;
|
} else {
|
if (data.isNine == 1) {
|
this.$refs.selector.showDefault(data.nineType)
|
setTimeout(() => {
|
if (this.$refs.selector.selectedItem.childrenId) {
|
this.nineTypeValue = this.$refs.selector.selectedItem
|
.childrenName
|
} else {
|
this.nineTypeValue = this.$refs.selector.selectedItem
|
.parentName;
|
}
|
}, 200)
|
}
|
}
|
}
|
|
if (key == "isFront") {
|
if (!data.isFront) {
|
this.form.isFront = 2;
|
} else {
|
if (data.isFront == 1) {
|
let {
|
index,
|
name
|
} = this.$getIndex(this.frontTypeList, data.frontType, "value",
|
"name");
|
this.frontTypeIndex = index;
|
this.frontTypeValue = name;
|
}
|
}
|
}
|
|
if (key == "legalGender" && data.legalGender) {
|
let {
|
index,
|
name
|
} = this.$getIndex(this.gender, data.legalGender, "value",
|
"name");
|
this.genderIndex = index;
|
this.genderValue = name;
|
}
|
|
if (key == "ethnicity" && data.ethnicity) {
|
let {
|
index,
|
name
|
} = this.$getIndex(this.nationTypeList, data.ethnicity, "value",
|
"name");
|
this.nationTypeIndex = index;
|
this.nationValue = name;
|
}
|
if (key == "noExplosionCategory" && data.noExplosionCategory) {
|
let {
|
index,
|
name
|
} = this.$getIndex(this.notSwindleTypeList, data.noExplosionCategory, "value",
|
"name")
|
this.notSwindleIndex = [index];
|
this.notSwindleValue = name;
|
}
|
|
|
})
|
this.$set(this.form, "jwd", `${Number(data.lng).toFixed(6)},${Number(data.lat).toFixed(6)}`)
|
this.form.building = arr.join("")
|
let labelList = data.placePoiLabelVOList;
|
let tempLabelList = [];
|
for (let i of labelList) { //过滤一级数据
|
if (i.type != 1) {
|
tempLabelList.push(i)
|
}
|
}
|
this.firstId = tempLabelList[0].poiCode;
|
this.categoryValue = tempLabelList[1].labelName;
|
this.form.label = tempLabelList[1].poiCode
|
// setTimeout(() => {
|
let firstIndex = this.categoryList[0].findIndex(i => i.categoryNo ==
|
tempLabelList[0].poiCode)
|
let childIndex = this.categoryList[1].findIndex(i => i.categoryNo ==
|
tempLabelList[1].poiCode)
|
this.categoryIndex = [firstIndex, childIndex]
|
// }, 500)
|
|
|
Object.keys(this.comprehensiveData).forEach(key => {
|
this.comprehensiveData[key].forEach(item => {
|
if (!data[item.name]) {
|
item.value = dpaEntity[item.name] || '未完善'
|
item.value = gridEntity[item.name] || '未完善'
|
} else {
|
item.value = data[item.name] || '未完善'
|
if (item.name == "imageUrls") {
|
item.value = this.$setImageUrl(data[item.name])
|
// item.value = minioBaseUrl + data[item.name] || '未完善'
|
}
|
}
|
})
|
this.publicData[key].forEach(item => {
|
if (!data[item.name]) {
|
item.value = dpaEntity[item.name] || '未完善'
|
} else {
|
item.value = data[item.name] || '未完善'
|
}
|
})
|
})
|
|
placePractitioner.forEach((item, index) => {
|
this.$nextTick(() => {
|
if (item.ethnicity) {
|
let obj = this.$getIndex(this.nationTypeList, item.ethnicity,
|
"value", "name")
|
this.$refs.formItemRef[index].nationValue = obj.name;
|
this.$refs.formItemRef[index].nationTypeIndex = obj.index;
|
}
|
|
if (typeof(item.gender) == 'number') {
|
let obj = this.$getIndex(this.$refs.formItemRef[index]
|
.gender, item.gender, "value", "name")
|
this.$refs.formItemRef[index].genderValue = obj.name;
|
this.$refs.formItemRef[index].genderIndex = obj.index;
|
}
|
if (item.employerImg == "" || item.employerImg == null) {
|
item.employerImg = [];
|
} else {
|
item.employerImg = this.$setImageUrl(item.employerImg, 2)
|
}
|
|
this.$refs.formItemRef[index].form = item
|
})
|
})
|
})
|
},
|
|
//选择九小场所类型
|
comfirmNineType(val) {
|
if (val.childrenId) {
|
this.form.nineType = val.childrenId;
|
this.nineTypeValue = val.childrenName;
|
} else {
|
this.form.nineType = val.parentId;
|
this.nineTypeValue = val.parentName;
|
}
|
},
|
|
//表单提交
|
submit() {
|
if (!this.form.placeName) {
|
this.$showTips("请输入场所名称")
|
return
|
}
|
|
if (!this.form.label) {
|
this.$showTips("请选择标签")
|
return
|
}
|
// this.$refs.form.validate().then(valid => {
|
// if (valid) {
|
if (this.form.images.length) {
|
let urls = []
|
this.form.images.forEach(e => {
|
urls.push(e.name)
|
})
|
this.form.imageUrls = urls.join(",")
|
} else {
|
this.form.imageUrls = ""
|
}
|
|
this.form.roleName = uni.getStorageSync("activeRole").roleName;
|
if (this.form.isNine == 2 && this.form.nineType) {
|
this.form.nineType = "";
|
}
|
if (this.form.isFront == 2 && this.form.frontType) {
|
this.form.frontType = "";
|
}
|
|
if (this.form.isNine == 1 && !this.form.nineType) {
|
this.$showTips("请选择九小场所类型")
|
return
|
}
|
|
if (this.form.isFront == 1 && !this.form.frontType) {
|
this.$showTips("请选择阵地类型")
|
return
|
}
|
this.form.lng = Number(this.form.lng).toFixed(8)
|
this.form.lat = Number(this.form.lat).toFixed(8)
|
|
delete this.form.images;
|
if (this.personNum > 0) {
|
const placePractitioner = []
|
this.$refs.formItemRef.forEach(item => {
|
item.form.placeId = this.form.placeId
|
item.form.employerImg = this.$formattingUrls(item.form.employerImg);
|
placePractitioner.push(item.form)
|
})
|
this.form.placePractitioner = placePractitioner
|
}
|
|
|
|
|
add(this.form).then(res => {
|
this.$showTips("提交成功", "success");
|
setTimeout(() => {
|
uni.navigateBack()
|
}, 300)
|
|
})
|
},
|
|
|
|
//获取当前位置信息
|
getCurrentLocation() {
|
uni.getLocation({
|
type: 'gcj02', // 坐标系类型
|
success: (res) => {
|
// var latitude = res.latitude; // 维度
|
// var longitude = res.longitude; // 经度
|
|
// this.form.lng = longitude
|
// this.form.lat = latitude
|
// this.form.jwd =
|
// `${Number(res.longitude).toFixed(6)},${Number(res.latitude).toFixed(6)}`
|
},
|
complete: (res) => {
|
if (res.latitude) {
|
this.$set(this.form, "x", res.longitude)
|
this.$set(this.form, "y", res.latitude)
|
} else {
|
uni.showModal({
|
title: "提示!",
|
content: `获取定位信息失败 ${res.errMsg}`,
|
showCancel: false
|
})
|
}
|
}
|
});
|
},
|
|
getLocation() {
|
uni.chooseLocation({
|
success: (res) => {
|
console.log("location==>", res);
|
this.form.lat = res.latitude;
|
this.form.lng = res.longitude;
|
this.form.location = res.address;
|
this.form.jwd =
|
`${Number(res.longitude).toFixed(6)},${Number(res.latitude).toFixed(6)}`
|
}
|
})
|
},
|
|
async getDoorplateAddressList(code, type) {
|
const res = await getDoorplateAddressList(code, type)
|
return res.data
|
},
|
|
confirmPicker(e) {
|
|
if (e.value[4]) {
|
this.selectValue = e.value
|
|
let arr = this.selectValue.map(e => e.name)
|
this.form.building = arr.join("")
|
|
this.form.buildingCode = e.value[4].code
|
}
|
this.showPicker = false
|
},
|
|
confirmNineTypePicker(e) {
|
this.nineTypeIndex = e.indexs;
|
this.nineTypeValue = e.value[0].name;
|
this.form.nineType = e.value[0].value;
|
this.showNineTypePicker = false;
|
},
|
|
confirmFrontTypePicker(e) {
|
this.frontTypeIndex = e.indexs;
|
this.frontTypeValue = e.value[0].name;
|
this.form.frontType = e.value[0].value;
|
this.showFrontTypePicker = false;
|
},
|
|
//选择民族
|
confirmNation(e) {
|
this.nationIndex = e.indexs;
|
this.nationValue = e.value[0].name;
|
this.form.placeExtEntity.ethnicity = e.value[0].value;
|
this.showNationPicker = false;
|
},
|
|
//选择性别
|
confirmGender(e) {
|
this.genderIndex = e.indexs;
|
this.genderValue = e.value[0].name;
|
this.form.placeExtEntity.legalGender = e.value[0].value;
|
this.showGenderPicker = false;
|
},
|
|
//选择无诈类别
|
confirmNotSwindleType(e) {
|
this.notSwindleIndex = e.indexs;
|
this.notSwindleValue = e.value[0].name;
|
this.form.noExplosionCategory = e.value[0].value;
|
this.showNotSwindleTypePicker = false;
|
},
|
|
//弹出层打开
|
popup() {
|
// this.$refs.uniPopup.open()
|
this.isShowCatePicker = true;
|
|
},
|
|
imgPreview(value) {
|
uni.previewImage({
|
urls: minioBaseUrl + [value],
|
})
|
},
|
|
addPerson() {
|
this.personNum++
|
this.personNumArr.push(1)
|
},
|
|
deletePerson(index) {
|
this.personNum--;
|
this.personNumArr.splice(index, 1)
|
},
|
|
//识别成功
|
recognizeSuccess(e, key) {
|
let {
|
detail: {
|
name,
|
id,
|
address,
|
gender,
|
nationality
|
}
|
} = e;
|
|
if (key == "principal") { //负责人
|
this.form.principal = name.text;
|
this.form.principalIdCard = id.text;
|
} else if (key == "legal") { //法人
|
this.form.placeExtEntity.legalPerson = name.text;
|
this.form.placeExtEntity.legalIdCard = id.text;
|
} else { //房东
|
this.form.placeExtEntity.landlordName = name.text;
|
this.form.placeExtEntity.landlordIdCard = id.text;
|
}
|
},
|
|
//识别从业人员身份证信息
|
recognizePersonSuccess(e, index) {
|
let {
|
detail: {
|
name,
|
id,
|
address,
|
gender,
|
nationality
|
}
|
} = e;
|
|
this.$refs.formItemRef[index].form.name = name.text; //姓名
|
this.$refs.formItemRef[index].form.idCard = id.text; //身份证号
|
this.$refs.formItemRef[index].genderValue = gender.text; //性别
|
this.$refs.formItemRef[index].nationValue = `${nationality.text}族`; //民族
|
this.$refs.formItemRef[index].form.gender = this.getValue(this.gender, gender.text).value;
|
this.$refs.formItemRef[index].form.ethnicity = this.getValue(this.nationTypeList, `${nationality.text}族`)
|
.value;
|
this.$refs.formItemRef[index].gender = [this.getValue(this.gender, gender.text).index];
|
this.$refs.formItemRef[index].nationTypeIndex = [this.getValue(this.nationTypeList, `${nationality.text}族`)
|
.index
|
];
|
|
|
},
|
|
|
getValue(arr, name) {
|
for (let i = 0, ii = arr.length; i < ii; i++) {
|
if (arr[i].name == name) {
|
return {
|
index: i,
|
value: arr[i].value
|
}
|
}
|
}
|
}
|
|
}
|
}
|
</script>
|
|
<style scoped lang="scss">
|
.container {
|
position: relative;
|
width: calc(100% - 60rpx);
|
// height: 100%;
|
display: flex;
|
flex-direction: column;
|
background: #f5f5f5;
|
padding: 0 30rpx 20rpx 30rpx;
|
|
.wrap {
|
width: 100%;
|
margin-bottom: 120rpx;
|
}
|
|
.box-title {
|
padding: 10px 0;
|
|
.title-more {
|
display: flex;
|
align-items: center;
|
height: 100%;
|
|
.item {
|
width: 50rpx;
|
height: 40rpx;
|
color: #ffffff;
|
padding: 6rpx;
|
font-size: 2rpx;
|
text-align: center;
|
line-height: 20px;
|
}
|
|
}
|
}
|
|
.item {
|
margin-top: 20rpx;
|
background-color: #ffffff;
|
border-radius: 8rpx;
|
padding: 0 30rpx;
|
|
.form-item {
|
background-color: #ffffff;
|
padding: 2rpx 10px;
|
border-bottom: 0.1px solid #eff1f3;
|
}
|
|
.label {
|
padding: 10rpx 30rpx;
|
display: flex;
|
background-color: #ffffff;
|
flex-wrap: wrap;
|
|
.activeLabel {
|
// width: 80rpx;
|
margin-left: 10rpx;
|
margin-top: 10rpx
|
}
|
}
|
|
|
|
}
|
|
.pic {
|
background-color: #ffffff;
|
padding-bottom: 20rpx;
|
|
/deep/ .u-upload__button {
|
border: 1rpx solid #EEEEEE;
|
background-color: #fff;
|
}
|
}
|
|
.image {
|
padding: 20rpx;
|
}
|
|
.bottom {
|
padding: 20rpx;
|
background-color: #ffffff;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
|
.btn {
|
width: calc(100% - 40rpx);
|
}
|
}
|
}
|
|
/deep/ .u-form-item {
|
background-color: #ffffff;
|
padding: 2rpx 10px;
|
border-bottom: 1px solid #eff1f3;
|
}
|
|
.red {
|
background-color: red;
|
border-radius: 10rpx 0rpx 0rpx 10rpx;
|
}
|
|
.orange {
|
background-color: orange;
|
}
|
|
.green {
|
background-color: green;
|
border-radius: 0rpx 10rpx 10rpx 0rpx;
|
}
|
|
|
.address-row {
|
flex: 1;
|
}
|
|
.address-content {
|
width: calc(100% - 116rpx - 15rpx);
|
margin-right: 15rpx;
|
}
|
|
.location-btn {
|
width: 116rpx;
|
height: 46rpx;
|
line-height: 46rpx;
|
border-radius: 4rpx;
|
border: 1px solid currentColor;
|
padding: 0;
|
background-color: #fff;
|
text-align: center;
|
}
|
|
|
.practitioner {
|
background-color: #fff;
|
border-radius: 8rpx;
|
margin-top: 20rpx;
|
}
|
|
.recognize-btn {
|
padding: 12rpx;
|
border-radius: 6rpx;
|
background-color: #3c9cff;
|
margin-left: 30rpx;
|
}
|
</style>
|