| | |
| | | </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" v-if="!currentId"> |
| | | <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" v-if="!currentId"> |
| | | <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 class="form-item" labelWidth="100" label="备注:" prop="remark"> |
| | | <u--input border="none" v-model="form.remark" placeholder="请输入"> |
| | | </u--input> |
| | |
| | | </u-form> |
| | | </view> |
| | | <footer-btn @click="submit" text="保存" /> |
| | | <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="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> |
| | | |
| | | |
| | | <cate-selector ref="selector" @comfirm="comfirmNineType" /> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | import { |
| | | minioBaseUrl |
| | | } from "../../../common/setting"; |
| | | import { |
| | | bizDictionary, |
| | | bizDictionaryTree |
| | | } from '@/api/system/dict.js' |
| | | |
| | | import cateSelector from "../components/cateSelector.vue" |
| | | |
| | | export default { |
| | | mixins: [uploadMixin], |
| | | components: { |
| | | lineItem, |
| | | boxTitle |
| | | boxTitle, |
| | | cateSelector |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | placeName: "", |
| | | principal: '', |
| | | principalPhone: '', |
| | | principalIdCard: '', |
| | | lat: '', |
| | | lng: '', |
| | | location: '' |
| | | location: '', |
| | | isNine: "", |
| | | isFront: "", |
| | | frontType: "", |
| | | nineType: "" |
| | | }, |
| | | rules: { |
| | | // 'buildingCode': { |
| | |
| | | // message: '请选择楼栋', |
| | | // trigger: ['blur', 'change'] |
| | | // }, |
| | | 'form.isNine': { |
| | | type: 'string', |
| | | required: true, |
| | | message: '是否九小场所', |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | | 'form.placeName': { |
| | | type: 'string', |
| | | required: true, |
| | |
| | | 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'] |
| | | } |
| | | ], |
| | | }, |
| | | |
| | |
| | | // name: 'username', |
| | | // value: "未完善", |
| | | // }, |
| | | { |
| | | label: "采集人", |
| | | name: 'createUserName', |
| | | value: "未完善" |
| | | }, |
| | | { |
| | | label: "采集时间", |
| | | name: 'createTime', |
| | | value: "未完善" |
| | | }, |
| | | // { |
| | | // label: "采集人", |
| | | // name: 'createUserName', |
| | | // value: "未完善" |
| | | // }, |
| | | // { |
| | | // label: "采集时间", |
| | | // name: 'createTime', |
| | | // value: "未完善" |
| | | // }, |
| | | // { |
| | | // label: "历史事件", |
| | | // value: "未完善", |
| | |
| | | secondId: "", |
| | | categoryValue: "", |
| | | houseCode: "", |
| | | from: "" |
| | | statusList: [{ |
| | | name: "是", |
| | | id: 1 |
| | | }, |
| | | { |
| | | name: "否", |
| | | id: 2 |
| | | } |
| | | ], |
| | | nineTypeList: [], //九小类型 |
| | | frontTypeList: [], //阵地 |
| | | nineTypeIndex: [0], |
| | | frontTypeIndex: [0], |
| | | showNineTypePicker: false, |
| | | showFrontTypePicker: false, |
| | | nineTypeValue: "", |
| | | frontTypeValue: "", |
| | | isView: false |
| | | |
| | | |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | options: { |
| | | styleIsolation: 'shared', // 解除样式隔离 |
| | | }, |
| | | onLoad(option) { |
| | | async onLoad(option) { |
| | | console.log("option===>", option); |
| | | await this.getCategory(); |
| | | await this.getAllBizDict(); |
| | | // this.getNineTypeList(); |
| | | |
| | | const { |
| | | type |
| | | } = option |
| | |
| | | if (option.id || option.houseCode) { |
| | | this.getBuildingDetail() |
| | | } |
| | | this.getCategory(); |
| | | this.getCurrentLocation(); |
| | | // this.getCategory(); |
| | | }, |
| | | |
| | | watch: { |
| | |
| | | // } |
| | | |
| | | }, |
| | | |
| | | onReady() { |
| | | this.$refs.form.setRules(this.rules) |
| | | }, |
| | | |
| | | methods: { |
| | | // getBuildingDetail(params = {}) { |
| | |
| | | // }) |
| | | // }) |
| | | // }, |
| | | |
| | | |
| | | async getAllBizDict() { |
| | | // 获取九小场所类型 |
| | | // await this.getBizDict('nineType', this.nineTypeList) |
| | | // 获取阵地 |
| | | await this.getBizDict('frontType', this.frontTypeList) |
| | | }, |
| | | |
| | | // 获取业务字典 |
| | | 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) { |
| | |
| | | id: this.currentId |
| | | } |
| | | } |
| | | uni.showLoading({ |
| | | title: "加载中..." |
| | | }) |
| | | getPlaceDetail({ |
| | | ...params, |
| | | ...idorCodeParams |
| | |
| | | code, |
| | | data |
| | | }) => { |
| | | uni.hideLoading(); |
| | | if (code !== 200) { |
| | | uni.showToast({ |
| | | title: "数据加载失败", |
| | |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | this.form.jwd = `${Number(data.lng).toFixed(6)},${Number(data.lat).toFixed(6)}` |
| | | 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 = []; |
| | |
| | | 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) |
| | | // 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 => { |
| | |
| | | }) |
| | | }, |
| | | |
| | | //选择九小场所类型 |
| | | 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() { |
| | | const that = this |
| | | this.$refs.form.validate().then(valid => { |
| | | if (valid) { |
| | | if (this.form?.images?.length > 0) { |
| | | let urls = [] |
| | | this.form.images.forEach(e => { |
| | | urls.push(e.name) |
| | | }) |
| | | this.form.imageUrls = urls.join(",") |
| | | } |
| | | if (!this.form.placeName) { |
| | | this.$showTips("请输入场所名称") |
| | | return |
| | | } |
| | | |
| | | this.form.roleName = uni.getStorageSync("activeRole").roleName; |
| | | add(this.form).then(res => { |
| | | uni.showToast({ |
| | | icon: 'success', |
| | | title: '保存成功' |
| | | }) |
| | | setTimeout(() => { |
| | | uni.navigateBack() |
| | | }, 300) |
| | | }) |
| | | } |
| | | if (!this.form.label) { |
| | | this.$showTips("请选择标签") |
| | | return |
| | | } |
| | | // this.$refs.form.validate().then(valid => { |
| | | // if (valid) { |
| | | if (this.form?.images?.length > 0) { |
| | | let urls = [] |
| | | this.form.images.forEach(e => { |
| | | urls.push(e.name) |
| | | }) |
| | | this.form.imageUrls = urls.join(",") |
| | | } |
| | | |
| | | 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 |
| | | } |
| | | |
| | | delete this.form.images; |
| | | |
| | | add(this.form).then(res => { |
| | | this.$showTips("提交成功", "success"); |
| | | setTimeout(() => { |
| | | uni.navigateBack() |
| | | }, 300) |
| | | |
| | | }) |
| | | }, |
| | | |
| | | |
| | | async buildColumn() { |
| | | //设置街道 |
| | |
| | | |
| | | setColumn(data, index) { |
| | | this.$set(this.pickColumns, index, data) |
| | | }, |
| | | |
| | | //获取当前位置信息 |
| | | 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() { |
| | |
| | | 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; |
| | | }, |
| | | |
| | | async changeHandler(e) { |
| | | const { |
| | | columnIndex, |