| | |
| | | <template>
|
| | | <div class="container">
|
| | | <view class="">
|
| | | <box-title title="基本信息"></box-title>
|
| | | <u-form labelWidth="70" :model="form" :rules="rules" ref="form" class="form">
|
| | | <u-form-item label="场所位置" required class="form-item" prop="localtion">
|
| | | <u--input border="none" v-model="form.localtion"></u--input>
|
| | | </u-form-item>
|
| | | <u-form-item label="场所名称" required class="form-item" prop="placeName">
|
| | | <u--input border="none" v-model="form.placeName"></u--input>
|
| | | </u-form-item>
|
| | | <u-form-item label="法人信息" required class="form-item" prop="legalPerson">
|
| | | <u--input border="none" v-model="form.legalPerson"></u--input>
|
| | | </u-form-item>
|
| | | <u-form-item label="法人电话" class="form-item">
|
| | | <u--input border="none" v-model="form.legalTel"></u--input>
|
| | | </u-form-item>
|
| | | <view class="container">
|
| | | <view class="main-content">
|
| | |
|
| | | <u-form labelWidth="80" :model="form" :rules="rules" ref="form" class="form">
|
| | |
|
| | | <view class="base">
|
| | | <box-title :title="'基本信息'"></box-title>
|
| | |
|
| | | <u-form-item label="场所位置" required class="form-item" prop="location" @click="getLocation">
|
| | | <u--textarea border="none" v-model="form.location" placeholder="请选择场所位置"></u--textarea>
|
| | | <u-icon slot="right" name="arrow-right"></u-icon>
|
| | | </u-form-item>
|
| | |
|
| | | <u-form-item label="经纬度" required class="form-item">
|
| | | <u--input border="none" v-model="jwd" placeholder="请选择场所位置" disabled
|
| | | disabledColor="#ffffff"></u--input>
|
| | | </u-form-item>
|
| | | <!-- <u-form-item class="form-item" label="标准地址" required prop="houseCodeBinds"
|
| | | @click="isShowPopup = true">
|
| | | <u--input v-if="!addressNames.length" border="none" disabled disabledColor="#ffffff"
|
| | | placeholder="请选择标准地址">
|
| | | </u--input>
|
| | | |
| | | <view v-if="addressNames.length">
|
| | | <view class="f-28" v-for="i in addressNames">
|
| | | {{i}}
|
| | | </view>
|
| | | </view>
|
| | | <u-icon slot="right" name="arrow-right"></u-icon>
|
| | | </u-form-item> -->
|
| | | <u-form-item label="场所名称" required class="form-item" prop="placeName">
|
| | | <u--input border="none" v-model="form.placeName" placeholder="请填写场所名称"></u--input>
|
| | | </u-form-item>
|
| | | <u-form-item label="法人信息" required class="form-item" prop="legalPerson">
|
| | | <u--input border="none" v-model="form.legalPerson" placeholder="请填写法人信息"></u--input>
|
| | | </u-form-item>
|
| | | <!-- <u-form-item label="法人身份证" :required="isRequired" class="form-item" prop="legalIdCard">
|
| | | <u--input border="none" v-model="form.legalIdCard" placeholder="请填写法人身份证"></u--input>
|
| | | </u-form-item> -->
|
| | | <u-form-item label="法人电话" class="form-item" prop="legalTel" required>
|
| | | <u--input border="none" type="number" v-model="form.legalTel" placeholder="请填写法人电话"></u--input>
|
| | | </u-form-item>
|
| | | <!-- <u-form-item class="form-item" :required="isRequired" :disabled="isDisabled" label="微信号:"
|
| | | prop="legalWxAccount">
|
| | | <u--input border="none" type="idcard" v-model="form.legalWxAccount" placeholder="请输入">
|
| | | </u--input>
|
| | | </u-form-item>
|
| | |
|
| | | <u-form-item @click="showGenderPicker = true" class="form-item" label="性别" prop="legalGender">
|
| | | <u--input border="none" v-model="genderValue" disabled disabledColor="#ffffff"
|
| | | placeholder="请选择性别">
|
| | | </u--input>
|
| | | <u-icon slot="right" name="arrow-right"></u-icon>
|
| | | </u-form-item>
|
| | | <u-form-item class="form-item" :required="isRequired" :disabled="isDisabled" label="年龄:"
|
| | | prop="legalAge">
|
| | | <u--input border="none" type="number" v-model="form.legalAge" placeholder="请输入">
|
| | | </u--input>
|
| | | </u-form-item>
|
| | | <u-form-item @click="showNationPicker = true" class="form-item" label="民族" prop="ethnicity">
|
| | | <u--input border="none" v-model="nationValue" disabled disabledColor="#ffffff"
|
| | | placeholder="请选择民族">
|
| | | </u--input>
|
| | | <u-icon slot="right" name="arrow-right"></u-icon>
|
| | | </u-form-item>
|
| | | <u-form-item class="form-item" :required="isRequired" :disabled="isDisabled" label="工作单位:"
|
| | | prop="employer">
|
| | | <u--input border="none" type="idcard" v-model="form.employer" placeholder="请输入">
|
| | | </u--input>
|
| | | </u-form-item>
|
| | | <u-form-item class="form-item" :required="isRequired" :disabled="isDisabled" label="岗位性质:"
|
| | | prop="legalJobNature">
|
| | | <u--input border="none" type="idcard" v-model="form.legalJobNature" placeholder="请输入">
|
| | | </u--input>
|
| | | </u-form-item>
|
| | | <u-form-item class="form-item" :required="isRequired" :disabled="isDisabled" label="户籍地址:"
|
| | | prop="legalRegisteredAddress">
|
| | | <u--textarea border="none" type="idcard" v-model="form.legalRegisteredAddress"
|
| | | placeholder="请输入">
|
| | | </u--textarea>
|
| | | </u-form-item>
|
| | | <u-form-item class="form-item" :required="isRequired" :disabled="isDisabled" label="居住地址:"
|
| | | prop="legalTempAddress">
|
| | | <u--textarea border="none" type="idcard" v-model="form.legalTempAddress" placeholder="请输入">
|
| | | </u--textarea>
|
| | | </u-form-item> -->
|
| | |
|
| | | </view>
|
| | |
|
| | |
|
| | | <view class="item bgc-ff mt-20" v-if="roleAlias !='xyzt'">
|
| | | <view class="flex j-c-s-b a-i-c" style="padding-top:12rpx;">
|
| | | <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.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.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.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.landlordWxAccount" placeholder="请输入">
|
| | | </u--input>
|
| | | </u-form-item>
|
| | | </view>
|
| | | </u-form>
|
| | | </view>
|
| | | <view class="">
|
| | | <box-title title="营业执照"></box-title>
|
| | | <view class="upload-img">
|
| | | <u-upload :fileList="form.imageUrls" :previewFullImage="uploadConfig.previewFullImage"
|
| | | :accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple" :maxCount="uploadConfig.maxCount"
|
| | | :capture="uploadConfig.capture" @afterRead="afterReadImg" @delete="deletePic">
|
| | | </u-upload>
|
| | |
|
| | | <view class="item bgc-ff mt-20" v-if="cateId == 160102 || cateId == 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.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.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.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.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.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.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.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.housemasterNumber" placeholder="请输入">
|
| | | </u--input>
|
| | | </u-form-item>
|
| | | </view>
|
| | |
|
| | |
|
| | | <view class="license">
|
| | | <box-title title="营业执照"></box-title>
|
| | | <view class="upload-img">
|
| | | <u-upload :fileList="form.imageUrls" :previewFullImage="uploadConfig.previewFullImage"
|
| | | :accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple"
|
| | | uploadIcon="/static/icon/upload.png" :maxCount="uploadConfig.maxCount"
|
| | | :capture="uploadConfig.capture" @afterRead="afterReadImg($event,'imageUrls')"
|
| | | @delete="deletePic($event,'imageUrls')">
|
| | | </u-upload>
|
| | | </view>
|
| | | </view>
|
| | | <view class="upload">
|
| | | <box-title title="场所平面图"></box-title>
|
| | | <view class="upload-img">
|
| | | <u-upload :fileList="form.planImageUrls" :previewFullImage="uploadConfig.previewFullImage"
|
| | | :accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple"
|
| | | uploadIcon="/static/icon/upload.png" :maxCount="uploadConfig.maxCount"
|
| | | :capture="uploadConfig.capture" @afterRead="afterReadImg($event,'planImageUrls')"
|
| | | @delete="deletePic($event,'planImageUrls')">
|
| | | </u-upload>
|
| | | </view>
|
| | | </view>
|
| | | <view class="practitioner">
|
| | | <view v-if="roleAlias ==='xyzt'">
|
| | | <box-title title="教职工信息"></box-title>
|
| | | </view>
|
| | | <view v-else>
|
| | | <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;" v-if="!currentId">
|
| | | <u-button type="success" plain @click="addPerson">再加一人</u-button>
|
| | | </view>
|
| | | </view>
|
| | | </view>
|
| | | <view class="">
|
| | | <box-title title="场所平面图"></box-title>
|
| | | <view class="upload-img">
|
| | | <u-upload :fileList="form.planImageUrls" :previewFullImage="uploadConfig.previewFullImage"
|
| | | :accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple" :maxCount="uploadConfig.maxCount"
|
| | | :capture="uploadConfig.capture" @afterRead="afterReadImg" @delete="deletePic">
|
| | | </u-upload>
|
| | |
|
| | |
|
| | | <u-popup :show="isShowPopup" mode="bottom" :round="12" closeable="true" @close="isShowPopup = false">
|
| | | <view class="popup-content">
|
| | | <view class="popup-title f-30">选择标准地址</view>
|
| | | <scroll-view class="popup-list" :scroll-y="true">
|
| | | <u-checkbox-group v-model="checkedPlace" iconPlacement="right" placement="column"
|
| | | @change="checkboxChange" shape="circle">
|
| | | <view class="popup-list-item flex j-c-s-b" v-for="(i,k) in placeList" :key="k">
|
| | | <text class="f-28" style="width:85%">{{i.addressName}}</text>
|
| | | <u-checkbox :name="k"></u-checkbox>
|
| | | </view>
|
| | |
|
| | | </u-checkbox-group>
|
| | | </scroll-view>
|
| | |
|
| | | </view>
|
| | | </view>
|
| | | <view class="practitioner">
|
| | | <box-title title="从业人员信息"></box-title>
|
| | | <view class="info" v-for="i in personNum" :key="i">
|
| | | <view class="title">人员信息-#{{ i }}</view>
|
| | | <formItem ref="formItemRef"></formItem>
|
| | |
|
| | | </u-popup>
|
| | |
|
| | | <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>
|
| | |
|
| | |
|
| | | <footer-btn @click="submit"></footer-btn>
|
| | |
|
| | | <!-- <view class="btn-group">
|
| | | <view>
|
| | | <u-button type="primary" @click="submit">提交</u-button>
|
| | | </view>
|
| | | </view>
|
| | | <u-button type="success" plain class="add-person" @click="addPerson">在加一人</u-button>
|
| | | <view class="btn-group">
|
| | | <u-button class="btn-item" type="primary" @click="submit">提交</u-button>
|
| | | <u-button class="btn-item" @click="pushPage">我上报的事件</u-button>
|
| | | </view>
|
| | | </div>
|
| | | <view class="mt-20">
|
| | | <u-button @click="pushPage">我上报的事件</u-button>
|
| | | </view>
|
| | | </view> -->
|
| | | </view>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import {
|
| | | updatePlaceExtData, |
| | | updatePlaceExtData,
|
| | | getPlaceDetail
|
| | | } from '@/api/placeExp/placeExp.js'
|
| | | import uploadMixin from "@/mixin/uploadMixin";
|
| | | import boxTtitle from '@/components/boxTitle/index.vue'
|
| | | import uploadMixin from "@/mixin/uploadMixinPlace";
|
| | | import boxTitle from "@/subPackage/workbench/components/boxTitle/index.vue"
|
| | | import formItem from '../components/formItem.vue'
|
| | | import {
|
| | | minioBaseUrl
|
| | | } from '@/common/setting'
|
| | | import {
|
| | | getPlaceList
|
| | | } from '@/api/place/place.js'
|
| | | import {
|
| | | bizDictionary
|
| | | } from '@/api/system/dict.js'
|
| | | export default {
|
| | | mixins: [uploadMixin],
|
| | | components: {
|
| | | formItem
|
| | | formItem,
|
| | | boxTitle
|
| | | },
|
| | | data() {
|
| | | return {
|
| | | form: { |
| | | id: '', |
| | | form: {
|
| | | id: '',
|
| | | placeId: '',
|
| | | localtion: '',
|
| | | location: '',
|
| | | placeName: '',
|
| | | legalPerson: '',
|
| | | legalTel: '',
|
| | | imageUrls: [],
|
| | | planImageUrls: []
|
| | | planImageUrls: [],
|
| | | houseCodeBinds: "",
|
| | | legalWxAccount: "",
|
| | | employer: "",
|
| | | legalAge: "",
|
| | | legalJobNature: "",
|
| | | legalRegisteredAddress: "",
|
| | | legalTempAddress: "",
|
| | | images: [],
|
| | | landlordName: "",
|
| | | landlordPhone: "",
|
| | | landlordIdCard: "",
|
| | | landlordWxAccount: "",
|
| | |
|
| | | studentNumber: "",
|
| | | workersNumber: "",
|
| | | securityNumber: "",
|
| | | guardNumber: "",
|
| | | temporarySecurityNumber: "",
|
| | | dayStudentsNumber: "",
|
| | | residentialStudentsNumber: "",
|
| | | housemasterNumber: ""
|
| | | },
|
| | | rules: {
|
| | | localtion: {
|
| | | "location": {
|
| | | required: true,
|
| | | message: '请选择地址',
|
| | | trigger: ['blur', 'change']
|
| | | },
|
| | | placeName: {
|
| | | "placeName": {
|
| | | required: true,
|
| | | message: '请填写场所名称',
|
| | | trigger: ['blur', 'change']
|
| | | },
|
| | | legalPerson: {
|
| | | "legalPerson": {
|
| | | required: true,
|
| | | message: '请填写法人信息',
|
| | | trigger: ['blur', 'change']
|
| | | }
|
| | | },
|
| | | "legalTel": [{
|
| | | required: true,
|
| | | message: '请填写法人电话',
|
| | | trigger: ['blur', 'change']
|
| | | },
|
| | | {
|
| | | validator: (rule, value, callback) => {
|
| | | return uni.$u.test.mobile(value);
|
| | | },
|
| | | message: '手机号码不正确',
|
| | | trigger: ['change', 'blur']
|
| | | }
|
| | | ]
|
| | | },
|
| | | personNum: 1,
|
| | | personNum: 0,
|
| | | curSelectSite: {},
|
| | | jwd: "",
|
| | | placeList: [],
|
| | | isShowPopup: false,
|
| | | checkedPlace: [],
|
| | | addressNames: [],
|
| | | nationTypeList: [], //民族
|
| | | nationTypeIndex: [0],
|
| | | nationValue: "",
|
| | | gender: [{ //性别
|
| | | value: 1,
|
| | | name: '男',
|
| | | },
|
| | | {
|
| | | value: 0,
|
| | | name: '女',
|
| | | }
|
| | | ],
|
| | | genderIndex: [0],
|
| | | genderValue: "",
|
| | | showNationPicker: false,
|
| | | showGenderPicker: false,
|
| | | personNumArr: [],
|
| | | cateId: "",
|
| | | roleAlias: uni.getStorageSync("activeRole").roleAlias,
|
| | | }
|
| | | },
|
| | | onShow() {
|
| | | this.curSelectSite = uni.getStorageSync('siteInfo') |
| | | this.getCsDetails()
|
| | | this.curSelectSite = uni.getStorageSync('siteInfo')
|
| | |
|
| | | },
|
| | | methods: { |
| | | getCsDetails() { |
| | | getPlaceDetail({ |
| | | placeId: this.curSelectSite.id |
| | | }).then(detailRes => { |
| | | const { code, data } = detailRes |
| | | if (code !== 200) { |
| | | uni.showToast({ |
| | | title: '数据请求失败', |
| | | icon: 'error' |
| | | }) |
| | | return |
| | | } |
| | | const placePractitioner = data?.placePractitioner || [] |
| | | Object.keys(this.form).forEach(key => { |
| | | this.form[key] = data[key] |
| | | if(key === 'imageUrls' || key === 'planImageUrls') { |
| | | this.form[key] = [] |
| | | !!data[key] && this.form[key].push() |
| | | } |
| | | }) |
| | | this.personNum = placePractitioner.length |
| | | this.$nextTick(() => { |
| | | console.log(placePractitioner); |
| | | this.$refs.formItemRef.forEach((item, index) => { |
| | | item.form = placePractitioner[index] |
| | | }) |
| | | }) |
| | | }) |
| | | onReady() {
|
| | | //onReady 为uni-app支持的生命周期之一
|
| | | this.$refs.form.setRules(this.rules)
|
| | |
|
| | | },
|
| | | async onLoad() {
|
| | | await this.getBizDict();
|
| | | },
|
| | |
|
| | | mounted() {
|
| | | this.getCsDetails();
|
| | | },
|
| | |
|
| | | methods: {
|
| | |
|
| | |
|
| | | // 获取民族
|
| | | getBizDict() {
|
| | | return new Promise(resolve => {
|
| | | const param = {
|
| | | code: "nationType"
|
| | | }
|
| | | bizDictionary(param).then(res => {
|
| | | if (res.code == 200) {
|
| | | res.data.forEach(e => {
|
| | | this.nationTypeList.push({
|
| | | name: e.dictValue,
|
| | | value: Number(e.dictKey)
|
| | | })
|
| | | })
|
| | | }
|
| | | })
|
| | | });
|
| | | },
|
| | | updatePlaceExt(data) { |
| | | data['imageUrls'] = JSON.stringify(data['imageUrls']) |
| | | data['planImageUrls'] = JSON.stringify(data['planImageUrls'])
|
| | | updatePlaceExtData({...data}).then(res => { |
| | | const { code } = res |
| | | if (code !== 200) { |
| | | uni.showToast({ |
| | | title: '提交失败', |
| | | icon: 'error' |
| | | }) |
| | | return |
| | | } |
| | | uni.showToast({ |
| | | title: '提交成功', |
| | | icon: 'success', |
| | | complete() { |
| | | setTimeout(() => { |
| | | uni.navigateBack() |
| | | }, 1500) |
| | | } |
| | | }) |
| | |
|
| | | checkboxChange(n) {
|
| | | console.log('change', n);
|
| | | let list = n;
|
| | | let ids = [];
|
| | | let names = []
|
| | | for (let i = 0, ii = list.length; i < ii; i++) {
|
| | | ids.push(this.placeList[list[i]].addressCode)
|
| | | names.push(this.placeList[list[i]].addressName)
|
| | | }
|
| | |
|
| | | this.$set(this.form, "houseCodeBinds", ids.join(","))
|
| | | this.addressNames = names;
|
| | | },
|
| | |
|
| | | getPlace(location) {
|
| | | getPlaceList({
|
| | | addressName: location
|
| | | }).then(res => {
|
| | | console.log(res)
|
| | | this.placeList = res.data;
|
| | | })
|
| | | },
|
| | |
|
| | | getLocation() {
|
| | | uni.chooseLocation({
|
| | | success: (res) => {
|
| | | const {
|
| | | address,
|
| | | latitude,
|
| | | longitude
|
| | | } = res
|
| | | this.form.location = address
|
| | | this.form.lat = latitude;
|
| | | this.form.lng = longitude;
|
| | | this.jwd = `${Number(longitude).toFixed(6)},${Number(latitude).toFixed(6)}`
|
| | | }
|
| | | })
|
| | | },
|
| | |
|
| | | getCsDetails() {
|
| | | getPlaceDetail({
|
| | | placeId: this.curSelectSite.id
|
| | | }).then(detailRes => {
|
| | | const {
|
| | | code,
|
| | | data
|
| | | } = detailRes
|
| | | if (code !== 200) {
|
| | | uni.showToast({
|
| | | title: '数据请求失败',
|
| | | icon: 'error'
|
| | | })
|
| | | return
|
| | | }
|
| | | this.getPlace(data.location);
|
| | | if (data.lat) {
|
| | | this.jwd = `${Number(data.lng).toFixed(6)},${Number(data.lat).toFixed(6)}`
|
| | | }
|
| | | this.cateId = data.poiCode;
|
| | | const placePractitioner = data?.placePractitioner || []
|
| | | // Object.keys(this.form).forEach(key => {
|
| | | // this.form[key] = data[key]
|
| | | // if (key === 'imageUrls' || key === 'planImageUrls') {
|
| | | // data[key] = data[key] || ''
|
| | | // this.form[key] = []
|
| | | // if (!!data[key]) {
|
| | | // data[key] = JSON.parse(data[key])
|
| | | // if (Array.isArray(data[key])) {
|
| | | // this.form[key] = data[key]
|
| | | // } else {
|
| | | // this.form[key].push(data[key])
|
| | | // }
|
| | | // }
|
| | | // }
|
| | | // })
|
| | |
|
| | | for (let i in this.form) {
|
| | | if (i === 'imageUrls' || i === 'planImageUrls') {
|
| | | if (this.form[i]) {
|
| | | if (data[i]) {
|
| | | this.form[i] = this.setImageUrl(i, data[i].split('、'))
|
| | | } else {
|
| | | this.form[i] = []
|
| | | }
|
| | |
|
| | | }
|
| | | } else {
|
| | | this.form[i] = data[i]
|
| | | }
|
| | | }
|
| | |
|
| | | this.personNum = placePractitioner.length
|
| | | this.personNumArr = placePractitioner;
|
| | | // const componetns = this.$refs.formItemRef || []
|
| | | placePractitioner.forEach((item, index) => {
|
| | | this.$nextTick(() => {
|
| | | if (item.ethnicity) {
|
| | | let obj = this.$getIndex(this.nationTypeList, item.ethnicity,
|
| | | "value", "name")
|
| | | console.log("ethnicity==>", obj)
|
| | | if (obj) {
|
| | | 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
|
| | | })
|
| | | })
|
| | | })
|
| | | },
|
| | |
|
| | |
|
| | |
|
| | | //选择民族
|
| | | confirmNation(e) {
|
| | | this.nationIndex = e.indexs;
|
| | | this.nationValue = e.value[0].name;
|
| | | this.form.ethnicity = e.value[0].value;
|
| | | this.showNationPicker = false;
|
| | | },
|
| | |
|
| | | //选择性别
|
| | | confirmGender(e) {
|
| | | this.genderIndex = e.indexs;
|
| | | this.genderValue = e.value[0].name;
|
| | | this.form.legalGender = e.value[0].value;
|
| | | this.showGenderPicker = false;
|
| | | },
|
| | |
|
| | |
|
| | | setImageUrl(key, arr) {
|
| | | let urls = [];
|
| | | for (let i of arr) {
|
| | | urls.push({
|
| | | name: i,
|
| | | url: `${minioBaseUrl}${i}`
|
| | | })
|
| | | }
|
| | | return urls
|
| | | },
|
| | |
|
| | | getImageUrl(key) {
|
| | | if (this.form[key].length) {
|
| | | let urls = [];
|
| | | for (let i of this.form[key]) {
|
| | | urls.push(i.name)
|
| | | }
|
| | | return urls.join('、');
|
| | | } else {
|
| | | return "";
|
| | | }
|
| | | },
|
| | |
|
| | | updatePlaceExt(data) {
|
| | | data['imageUrls'] = this.getImageUrl('imageUrls')
|
| | | data['planImageUrls'] = this.getImageUrl('planImageUrls')
|
| | | data.confirmFlag = 1;
|
| | | // data['imageUrls'] = data['imageUrls'].join('、')
|
| | | // data['planImageUrls'] = data['planImageUrls'].join('、')
|
| | | updatePlaceExtData({
|
| | | ...data
|
| | | }).then(res => {
|
| | | const {
|
| | | code
|
| | | } = res
|
| | | if (code !== 200) {
|
| | | uni.showToast({
|
| | | title: '提交失败',
|
| | | icon: 'error'
|
| | | })
|
| | | return
|
| | | }
|
| | | uni.showToast({
|
| | | title: '提交成功',
|
| | | complete() {
|
| | | setTimeout(() => {
|
| | | uni.navigateBack()
|
| | | }, 1000)
|
| | | }
|
| | | })
|
| | | })
|
| | | },
|
| | |
|
| | | submit() {
|
| | | if (this.personNum > 0) {
|
| | | const placePractitioner = []
|
| | | this.$refs.formItemRef.forEach(item => {
|
| | | console.log("item====>", item);
|
| | | item.form.placeId = this.form.placeId
|
| | | if (item.form.employerImg == null) {
|
| | | item.form.employerImg = "";
|
| | | } else {
|
| | | item.form.employerImg = this.$formattingUrls(item.form.employerImg);
|
| | | }
|
| | | // item.form.employerImg = "";
|
| | | placePractitioner.push(item.form)
|
| | | })
|
| | | this.form.placePractitioner = placePractitioner
|
| | | }
|
| | |
|
| | | this.$refs.form.validate().then(res => {
|
| | | this.updatePlaceExt(this.form)
|
| | | }).catch(errors => {
|
| | | uni.$u.toast('请完善基本信息')
|
| | | })
|
| | | },
|
| | |
|
| | | pushPage() {
|
| | | this.$u.func.globalNavigator(`/subPackage/workbench/views/cshw?placeId=${this.form.placeId}`)
|
| | | },
|
| | |
|
| | | addPerson() {
|
| | | this.personNum++
|
| | | this.personNumArr.push(1)
|
| | | },
|
| | | submit() {
|
| | | const placePractitioner = []
|
| | | this.$refs.formItemRef.forEach(item => { |
| | | item.form.placeId = this.form.placeId
|
| | | placePractitioner.push(item.form)
|
| | | })
|
| | | this.form.placePractitioner = placePractitioner |
| | | this.updatePlaceExt(this.form)
|
| | | }, |
| | | pushPage() { |
| | | this.$u.func.globalNavigator('/subPackage/workbench/views/cshw') |
| | |
|
| | | deletePerson(index) {
|
| | | this.personNum--;
|
| | | this.personNumArr.splice(index, 1)
|
| | | },
|
| | |
|
| | | //识别成功
|
| | | recognizeSuccess(e, key) {
|
| | | let {
|
| | | detail: {
|
| | | name,
|
| | | id
|
| | | }
|
| | | } = e;
|
| | |
|
| | | this.form.landlordName = name.text;
|
| | | this.form.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].genderIndex = [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 lang="scss" scoped>
|
| | | <style>
|
| | | page {
|
| | | background-color: #f6f6f6;
|
| | | background: #F5F5F5;
|
| | | }
|
| | |
|
| | | </style>
|
| | | <style lang="scss" scoped>
|
| | | .container {
|
| | | padding-bottom: 300rpx;
|
| | | height: 100%;
|
| | | display: flex;
|
| | | flex-direction: column;
|
| | |
|
| | | .form {
|
| | | margin-top: 20rpx;
|
| | | .main-content {
|
| | | // height: 0;
|
| | | // flex: 1;
|
| | | // overflow-y: auto;
|
| | | padding: 0 30rpx 250rpx 30rpx;
|
| | |
|
| | | .form-item {
|
| | | .base,
|
| | | .license,
|
| | | .upload,
|
| | | .practitioner {
|
| | | background-color: #fff;
|
| | | padding: 0 20rpx;
|
| | | border-bottom: 1rpx solid #f6f6f6;
|
| | | border-radius: 8rpx;
|
| | | margin-top: 20rpx;
|
| | | padding: 30rpx;
|
| | | }
|
| | |
|
| | | }
|
| | | .license,
|
| | | .upload {
|
| | | padding-bottom: 20rpx !important;
|
| | |
|
| | | .upload-img {
|
| | | background-color: #fff;
|
| | | padding: 20rpx;
|
| | | padding-bottom: 10rpx;
|
| | | margin-top: 20rpx;
|
| | | }
|
| | | .upload-img {
|
| | | margin-top: 20rpx;
|
| | | }
|
| | | }
|
| | |
|
| | | .add-person {
|
| | | width: 30%;
|
| | | margin: 20rpx auto;
|
| | | }
|
| | | .practitioner {
|
| | | .info {
|
| | | margin-top: 20rpx;
|
| | |
|
| | | .practitioner {
|
| | | .info {
|
| | | margin-top: 20rpx;
|
| | | .title {
|
| | | margin-bottom: 10rpx;
|
| | | text-align: center;
|
| | | }
|
| | | }
|
| | |
|
| | | .title {
|
| | | text-align: center;
|
| | | font-size: 30rpx;
|
| | | margin-bottom: 10rpx;
|
| | | .add-person {
|
| | | margin-top: 20rpx;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .btn-group {
|
| | | background-color: #fff;
|
| | | position: fixed;
|
| | | bottom: 0;
|
| | | left: 0;
|
| | | width: calc(100% - 40rpx);
|
| | | padding: 20rpx;
|
| | | border-top: 1rpx solid #f6f6f6;
|
| | | z-index: 999;
|
| | |
|
| | | .btn-item {
|
| | | margin-top: 20rpx;
|
| | | }
|
| | |
|
| | | .btn-group {
|
| | | padding: 20rpx;
|
| | | z-index: 999;
|
| | | background-color: #fff;
|
| | | width: calc(100% - 40rpx);
|
| | | position: fixed;
|
| | | left: 0;
|
| | | bottom: 0;
|
| | | padding-bottom: calc(env(safe-area-inset-bottom) + 20rpx);
|
| | | z-index: 999;
|
| | | }
|
| | | }
|
| | |
|
| | | /deep/ .u-form-item {
|
| | | border-bottom: 1rpx solid #f5f5f5;
|
| | | }
|
| | |
|
| | | /deep/ .u-upload__button {
|
| | | border: 1rpx solid #EEEEEE;
|
| | | background-color: #fff;
|
| | | }
|
| | |
|
| | |
|
| | | .popup-content {
|
| | | width: 100%;
|
| | | padding: 0 30rpx 30rpx;
|
| | | box-sizing: border-box;
|
| | | background-color: #fff;
|
| | | // height: 800rpx;
|
| | |
|
| | | .popup-title {
|
| | | padding: 30rpx 0;
|
| | | text-align: center;
|
| | | font-weight: bold;
|
| | | }
|
| | |
|
| | | .popup-list {
|
| | | height: 600rpx;
|
| | | margin-top: 20rpx;
|
| | | }
|
| | |
|
| | | .popup-list-item {
|
| | | padding: 20rpx 0;
|
| | | border-bottom: 1px solid #f1f1f1;
|
| | | position: relative;
|
| | | }
|
| | |
|
| | | .address-name {
|
| | | width: 90%;
|
| | | }
|
| | |
|
| | | .check-icon {
|
| | | position: absolute;
|
| | | right: 20rpx;
|
| | | top: 20rpx;
|
| | | }
|
| | | }
|
| | |
|
| | | .item {
|
| | | padding: 0 30rpx;
|
| | | border-radius: 8rpx;
|
| | | }
|
| | |
|
| | | .recognize-btn {
|
| | | padding: 12rpx;
|
| | | border-radius: 6rpx;
|
| | | background-color: #3c9cff;
|
| | | margin-left: 30rpx;
|
| | | }
|
| | | </style> |