Browse Source

bug处理

feature
tianqian 2 years ago
parent
commit
b2f1c4dcd7
  1. 4
      src/views/modules/shequzhili/tuceng/anquan/anquanxuncha/record.vue
  2. 5
      src/views/modules/shequzhili/tuceng/anquan/shebei/record.vue
  3. 906
      src/views/modules/shequzhili/tuceng/anquan/yinhuan/addForm.vue
  4. 7
      src/views/modules/shequzhili/tuceng/anquan/yinhuan/record.vue
  5. 2
      src/views/modules/shequzhili/tuceng/zhonghe/shebei/addForm.vue
  6. 5
      src/views/modules/shequzhili/tuceng/zhonghe/shebei/record.vue

4
src/views/modules/shequzhili/tuceng/anquan/anquanxuncha/record.vue

@ -83,8 +83,8 @@
list-type="picture"
:before-upload="beforeImgUpload"
>
<i class="el-icon-plus avatar-uploader-icon"></i>
最多三张图片
<div v-if="scope.row.imgList.length != 3"><i class="el-icon-plus avatar-uploader-icon"></i>
最多三张图片</div>
</el-upload>
</div>

5
src/views/modules/shequzhili/tuceng/anquan/shebei/record.vue

@ -54,7 +54,7 @@
</template>
</el-table-column>
<el-table-column prop="inspectResult" label="检查结果" align="center" width="200px">
<el-table-column prop="inspectResult" label="检查结果" align="center">
<template slot-scope="scope">
<el-select v-if="scope.row.isEdit" v-model="scope.row.inspectResult" placeholder="请选择" class="input-width" size="small" clearable>
<el-option v-for="subItem in optionResult" :key="subItem.value" :label="subItem.label" :value="subItem.value"></el-option>
@ -102,8 +102,7 @@
list-type="picture"
:before-upload="beforeImgUpload"
>
<i class="el-icon-plus avatar-uploader-icon"></i>
最多三张图片
<div v-if="scope.row.imgList.length != 3"><i class="el-icon-plus avatar-uploader-icon"></i> 最多三张图片</div>
</el-upload>
</div>

906
src/views/modules/shequzhili/tuceng/anquan/yinhuan/addForm.vue

@ -7,62 +7,46 @@
</span>
<div>
<div class="dialog-h-content scroll-h">
<el-form :inline="true" :model="formData" ref="form" :rules="dataRule" :label-width="'90px'" v-if="pageType != 'view'">
<el-form :inline="true" :model="formData" ref="form" :rules="dataRule" :label-width="'90px'"
v-if="pageType != 'view'">
<el-row>
<el-col :span="8">
<el-form-item label="上报时间" prop="reportTime">
<template slot-scope="scope">
<el-date-picker v-model="formData.reportTime" type="date" class="input-width" value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
<el-date-picker v-model="formData.reportTime" type="date" class="input-width"
value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
</template>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="隐患场所" prop="dangerPlaceName">
<el-input v-model="formData.dangerPlaceName" class="u-item-width-normal" size="small" clearable placeholder="请输入"></el-input>
<el-input v-model="formData.dangerPlaceName" class="u-item-width-normal" size="small"
clearable placeholder="请输入"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="所属网格" prop="gridId">
<el-select class="u-item-width-normal" v-model="formData.gridId" placeholder="全部" size="small" clearable>
<el-option v-for="item in gridList" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-select class="u-item-width-normal" v-model="formData.gridId" placeholder="全部"
size="small" clearable>
<el-option v-for="item in gridList" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="隐患内容" prop="dangerContent">
<el-input
type="textarea"
:rows="2"
style="width:500px"
v-model="formData.dangerContent"
:disabled="disabled"
class="u-item-width-normal"
size="small"
clearable
placeholder="请输入"
></el-input>
<el-input type="textarea" :rows="2" style="width:500px" v-model="formData.dangerContent"
:disabled="disabled" class="u-item-width-normal" size="small" clearable
placeholder="请输入"></el-input>
<div v-if="pageType != 'view'" style="margin-top:10px">
<!-- :data="{ customerId: customerId }" -->
<el-upload
:headers="$getElUploadHeaders()"
class="avatar-uploader"
:action="uploadUrl"
:data="{ customerId: customerId }"
:show-file-list="true"
:file-list="formData.imgList"
:on-preview="handleImgPreview"
:on-success="handleImgSuccess"
:on-remove="handleImgRemove"
:on-exceed="handleImgExceed"
:before-upload="beforeImgUpload"
list-type="picture-card"
:limit="3"
>
<i class="el-icon-plus avatar-uploader-icon"></i>
最多三张图片
</el-upload>
<el-upload :headers="$getElUploadHeaders()" class="avatar-uploader"
:action="uploadUrl" :data="{ customerId: customerId }" :show-file-list="true"
:file-list="formData.imgList" :on-preview="handleImgPreview"
:on-success="handleImgSuccess" :on-remove="handleImgRemove"
:on-exceed="handleImgExceed" :before-upload="beforeImgUpload"
list-type="picture-card" :limit="3">
<i class="el-icon-plus avatar-uploader-icon"></i> 最多三张图片 </el-upload>
</div>
<!-- {{ formData.imgList }} -->
<!-- <div class="div-content" v-if="pageType != 'add'">
@ -83,34 +67,24 @@
</el-select>
</el-form-item> -->
<el-form-item label="上报人" prop="reportPerson">
<el-input v-model="formData.reportPerson" class="u-item-width-normal" size="small" clearable placeholder="请输入"></el-input>
<el-input v-model="formData.reportPerson" class="u-item-width-normal" size="small"
clearable placeholder="请输入"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话" prop="mobile">
<el-input v-model="formData.mobile" class="u-item-width-normal" size="small" clearable placeholder="请输入"></el-input>
<el-input v-model="formData.mobile" class="u-item-width-normal" size="small" clearable
placeholder="请输入"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="隐患位置" prop="location" style="display: block">
<el-select
v-model="formData.location"
:disabled="disabled"
filterable
remote
:reserve-keyword="true"
placeholder="请输入关键词"
:remote-method="remoteMethod"
:loading="loading"
@keyup.enter.native="remoteMethod(formData.location)"
>
<el-option
v-for="(item, index) in searchOptions"
@click.native="handleClickKey(index)"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
<el-select v-model="formData.location" :disabled="disabled" filterable remote
:reserve-keyword="true" placeholder="请输入关键词" :remote-method="remoteMethod"
:loading="loading" @keyup.enter.native="remoteMethod(formData.location)">
<el-option v-for="(item, index) in searchOptions"
@click.native="handleClickKey(index)" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
@ -123,7 +97,8 @@
<el-form-item label="上报时间" prop="reportTime">{{ formData.reportTime }}</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="隐患场所" prop="dangerPlaceName">{{ formData.dangerPlaceName }}</el-form-item>
<el-form-item label="隐患场所"
prop="dangerPlaceName">{{ formData.dangerPlaceName }}</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="所属网格" prop="gridId">{{ formData.gridName }}</el-form-item>
@ -132,18 +107,15 @@
<el-form-item label="隐患内容" prop="dangerContent">
<div>{{ formData.dangerContent }}</div>
<div class="div-content">
<el-image
v-if="formData.showImgList.length > 0"
style="width: 146px; height: 146px"
:src="formData.showImgList[0]"
fit="cover"
:preview-src-list="formData.showImgList"
></el-image>
<el-image v-if="formData.showImgList.length > 0" style="width: 146px; height: 146px"
:src="formData.showImgList[0]" fit="cover"
:preview-src-list="formData.showImgList"></el-image>
</div>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="处理情况" prop="handleStateName">{{ formData.handleStateName }}</el-form-item>
<el-form-item label="处理情况"
prop="handleStateName">{{ formData.handleStateName }}</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="上报人" prop="reportPerson">{{ formData.reportPerson }}</el-form-item>
@ -166,7 +138,10 @@
<!-- <el-button size="small" @click="resetData" v-if="pageType != 'view'">重置</el-button> -->
<el-button size="small" type="primary" :disabled="btnDisable" @click="handleComfirm"> </el-button>
</div>
<div class="recordBox"><record :disabled="disabled" :formType="pageType" :id="detailIdcopy" :info="{ agencyId: agencyId }"></record></div>
<div class="recordBox">
<record :disabled="disabled" :formType="pageType" :id="detailIdcopy" :info="{ agencyId: agencyId }">
</record>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleCancle" size="small"> </el-button>
@ -174,394 +149,461 @@
</span>
</el-dialog>
</template>
<script>
import { isMobile } from '@/utils/validate';
import { mapGetters } from 'vuex';
import { Loading } from 'element-ui'; // Loading
import { requestPost, requestGet } from '@/js/dai/request';
import daiMap from '@/utils/dai-map';
import nextTick from 'dai-js/tools/nextTick';
import record from './record';
let loading; //
let map;
var search;
var markers;
var infoWindowList;
var geocoder; //
export default {
props: {
dialogVisible: {
type: Boolean,
default: ''
},
defaultData: {
type: Object,
default: null
},
pageType: {
type: String,
default: ''
},
detailId: {
type: String,
default: ''
},
detailData: {
type: Object,
default: null
},
disabled: {
type: Boolean,
default: false
}
},
data() {
let checkMObile = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入联系电话'));
} else {
if (!isMobile(value)) {
callback(new Error('联系电话格式不正确'));
}
callback();
}
};
return {
detailIdcopy: this.detailId,
btnDisable: false,
user: '',
agencyId: '',
gridList: [], //list--
placeTypeList: [], //
handleStateArray: [{ value: '0', label: '待处理' }, { value: '1', label: '处理完成' }],
equipmentCategoryCodeArray: [{ value: '0', label: '九小场所' }, { value: '1', label: '企事业单位' }],
list: {},
formData: {
reportTime: '',
dangerPlaceName: '',
gridId: '',
dangerContent: '',
imgList: [],
reportPerson: '',
mobile: '',
location: ''
import {
isMobile
} from '@/utils/validate';
import {
mapGetters
} from 'vuex';
import {
Loading
} from 'element-ui'; // Loading
import {
requestPost,
requestGet
} from '@/js/dai/request';
import daiMap from '@/utils/dai-map';
import nextTick from 'dai-js/tools/nextTick';
import record from './record';
let loading; //
let map;
var search;
var markers;
var infoWindowList;
var geocoder; //
export default {
props: {
dialogVisible: {
type: Boolean,
default: ''
},
dataRule: {
reportTime: [{ required: true, message: '上报时间不能为空', trigger: 'bulr' }],
dangerPlaceName: [{ required: true, message: '隐患场所不能为空', trigger: 'bulr' }],
dangerContent: [{ required: true, message: '隐患内容不能为空', trigger: 'bulr' }],
reportPerson: [{ required: true, message: '上报人不能为空', trigger: 'bulr' }],
mobile: [{ required: true, message: '联系电话不能为空', trigger: 'blur' }],
gridId: [{ required: true, validator: '所属网格不能为空', trigger: 'blur' }],
location: [{ required: true, message: '场所地址不能为空', trigger: 'blur' }]
// content: [{ required: true, message: '', trigger: 'bulr' }, { max: 1000, message: '1000', trigger: 'blur' }]
defaultData: {
type: Object,
default: null
},
//
loading: false,
searchValue: '',
searchOptions: [],
resultList: [],
uploadUrl: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2',
customerId: localStorage.getItem('customerId')
};
},
watch: {},
components: { record },
created() {},
async mounted() {
console.log('detailId', this.detailId);
this.user = this.$store.state.user;
this.agencyId = this.user.agencyId;
this.startLoading();
this.loadGrid();
// this.loadplaceType();
if (this.pageType != 'add') {
this.getDetail();
} else {
this.initMap();
}
await this.endLoading();
this.endLoading();
},
methods: {
// handleImgSuccess(res, row) {
// if (res.code === 0 && res.msg === 'success') {
// row.imgList.push(res.data.url);
// this.computeImgShowList(row);
// } else {
// this.$message.error(res.msg);
// }
// },
handleImgSuccess(res, file, fileList) {
console.log('handleImgSuccess', file);
if (res.code === 0 && res.msg === 'success') {
let format = file.name.split('.').pop();
let srcType = file.raw.type;
let type = 'file';
console.log('==============================srcType: ', srcType);
if (srcType.indexOf('image') != -1) {
type = 'image';
} else if (srcType.indexOf('video') != -1) {
type = 'video';
}
this.formData.imgList.push({
format,
name: file.name,
size: file.size,
type,
url: res.data.url
});
console.log(this.formData.imgList);
} else {
this.$message.error(res.msg);
}
},
handleImgRemove(file) {
console.log('handleImgRemove', file);
if (file.response) {
let index = this.formData.imgList.findIndex(item => item.url == file.response.data.url);
this.formData.imgList.splice(index, 1);
} else if (file.url) {
let index = this.formData.imgList.findIndex(item => item.url == file.url);
this.formData.imgList.splice(index, 1);
pageType: {
type: String,
default: ''
},
detailId: {
type: String,
default: ''
},
detailData: {
type: Object,
default: null
},
disabled: {
type: Boolean,
default: false
}
},
handleImgPreview(file) {
console.log(file);
window.open(file.url || file.response.data.url);
data() {
let checkMObile = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入联系电话'));
} else {
if (!isMobile(value)) {
callback(new Error('联系电话格式不正确'));
}
callback();
}
};
return {
detailIdcopy: this.detailId,
btnDisable: false,
user: '',
agencyId: '',
gridList: [], //list--
placeTypeList: [], //
handleStateArray: [{
value: '0',
label: '待处理'
}, {
value: '1',
label: '处理完成'
}],
equipmentCategoryCodeArray: [{
value: '0',
label: '九小场所'
}, {
value: '1',
label: '企事业单位'
}],
list: {},
formData: {
reportTime: '',
dangerPlaceName: '',
gridId: '',
dangerContent: '',
imgList: [],
reportPerson: '',
mobile: '',
location: ''
},
dataRule: {
reportTime: [{
required: true,
message: '上报时间不能为空',
trigger: 'bulr'
}],
dangerPlaceName: [{
required: true,
message: '隐患场所不能为空',
trigger: 'bulr'
}],
dangerContent: [{
required: true,
message: '隐患内容不能为空',
trigger: 'bulr'
}],
reportPerson: [{
required: true,
message: '上报人不能为空',
trigger: 'bulr'
}],
mobile: [{
required: true,
message: '联系电话不能为空',
trigger: 'blur'
}],
gridId: [{
required: true,
validator: '所属网格不能为空',
trigger: 'blur'
}],
location: [{
required: true,
message: '场所地址不能为空',
trigger: 'blur'
}]
// content: [{ required: true, message: '', trigger: 'bulr' }, { max: 1000, message: '1000', trigger: 'blur' }]
},
//
loading: false,
searchValue: '',
searchOptions: [],
resultList: [],
uploadUrl: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2',
customerId: localStorage.getItem('customerId')
};
},
handleImgExceed() {
this.$message({
type: 'warning',
message: '文件数量最多不超过三个'
});
watch: {},
components: {
record
},
async loadGrid() {
const url = '/gov/org/customergrid/gridoption';
let params = {
agencyId: this.agencyId,
purpose: 'query'
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.gridList = data;
created() {},
async mounted() {
console.log('detailId', this.detailId);
this.user = this.$store.state.user;
this.agencyId = this.user.agencyId;
this.startLoading();
this.loadGrid();
// this.loadplaceType();
if (this.pageType != 'add') {
this.getDetail();
} else {
this.$message.error(msg);
this.initMap();
}
await this.endLoading();
this.endLoading();
},
async getDetail() {
const url = `/actual/base/hiddenDangerRecord/detail/${this.detailIdcopy}`;
const { data, code, msg } = await requestPost(url);
if (code === 0) {
console.log('详情数据', data);
this.formData = { ...data };
this.formData.showImgList = this.formData.imgList;
methods: {
// handleImgSuccess(res, row) {
// if (res.code === 0 && res.msg === 'success') {
// row.imgList.push(res.data.url);
// this.computeImgShowList(row);
// } else {
// this.$message.error(res.msg);
// }
// },
handleImgSuccess(res, file, fileList) {
console.log('handleImgSuccess', file);
if (res.code === 0 && res.msg === 'success') {
let format = file.name.split('.').pop();
let srcType = file.raw.type;
let type = 'file';
console.log('==============================srcType: ', srcType);
if (srcType.indexOf('image') != -1) {
type = 'image';
} else if (srcType.indexOf('video') != -1) {
type = 'video';
}
this.formData.imgList.push({
format,
name: file.name,
size: file.size,
type,
url: res.data.url
});
console.log(this.formData.imgList);
} else {
this.$message.error(res.msg);
}
},
handleImgRemove(file) {
console.log('handleImgRemove', file);
if (file.response) {
let index = this.formData.imgList.findIndex(item => item.url == file.response.data.url);
this.formData.imgList.splice(index, 1);
} else if (file.url) {
let index = this.formData.imgList.findIndex(item => item.url == file.url);
this.formData.imgList.splice(index, 1);
}
},
handleImgPreview(file) {
console.log(file);
window.open(file.url || file.response.data.url);
},
handleImgExceed() {
this.$message({
type: 'warning',
message: '文件数量最多不超过三个'
});
},
async loadGrid() {
const url = '/gov/org/customergrid/gridoption';
let params = {
agencyId: this.agencyId,
purpose: 'query'
};
const {
data,
code,
msg
} = await requestPost(url, params);
if (code === 0) {
this.gridList = data;
} else {
this.$message.error(msg);
}
},
async getDetail() {
const url = `/actual/base/hiddenDangerRecord/detail/${this.detailIdcopy}`;
const {
data,
code,
msg
} = await requestPost(url);
if (code === 0) {
console.log('详情数据', data);
this.formData = {
...data
};
this.formData.showImgList = this.formData.imgList;
this.formData.imgList = this.formData.imgList.map(item => {
return {
url: item,
name: ''
};
});
this.initMap();
} else {
this.$message.error(msg);
}
},
handleComfirm() {
this.save();
},
async handleAdd() {
// this.btnDisable = true;
// setTimeout(() => {
// this.btnDisable = false;
// }, 10000);
// nextTick(1000);
// const form = new Promise((resolve, reject) => {
// this.$refs['form'].validate(valid => {
// if (valid) resolve();
// });
// });
// const form1 = new Promise((resolve, reject) => {
// this.$refs['form1'].validate(valid => {
// if (valid) resolve();
// });
// });
// Promise.all([form1, form])
// .then(() => {
// this.addFuwu();
// })
// .catch(() => {
// app.util.validateRule(messageObj);
// this.btnDisable = false;
// });
},
async save() {
console.log('this.formData', this.formData);
this.formData.imgList = this.formData.imgList.map(item => {
return { url: item, name: '' };
return item.url;
});
this.initMap();
} else {
this.$message.error(msg);
}
},
handleComfirm() {
this.save();
},
async handleAdd() {
// this.btnDisable = true;
// setTimeout(() => {
// this.btnDisable = false;
// }, 10000);
// nextTick(1000);
// const form = new Promise((resolve, reject) => {
// this.$refs['form'].validate(valid => {
// if (valid) resolve();
// });
// });
// const form1 = new Promise((resolve, reject) => {
// this.$refs['form1'].validate(valid => {
// if (valid) resolve();
// });
// });
// Promise.all([form1, form])
// .then(() => {
// this.addFuwu();
// })
// .catch(() => {
// app.util.validateRule(messageObj);
// this.btnDisable = false;
// });
},
async save() {
console.log('this.formData', this.formData);
this.formData.imgList = this.formData.imgList.map(item => {
return item.url;
});
var url = '';
var params = {};
if (this.pageType == 'add') {
url = '/actual/base/hiddenDangerRecord/save';
} else {
url = '/actual/base/hiddenDangerRecord/update';
}
params = { ...this.formData };
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.$message.success('操作成功');
this.handleCancle();
// // this.resetData();
} else if (code >= 8000) {
this.$message.error(msg);
}
},
handleCancle() {
this.resetData();
this.$emit('handleClose');
},
resetData() {
this.$refs.form.resetFields();
},
//
startLoading() {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
});
},
//
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close();
}
},
// init
initMap() {
let { latitude, longitude } = this.$store.state.user;
if (this.formData.latitude && this.formData.longitude) {
latitude = this.formData.latitude;
longitude = this.formData.longitude;
}
if (!latitude || latitude == '' || latitude == '0') {
latitude = 39.9088810666821;
longitude = 116.39743841556731;
}
this.$nextTick(() => {
map = new daiMap(
document.getElementById('app_event'),
{ latitude, longitude },
{
var url = '';
var params = {};
if (this.pageType == 'add') {
url = '/actual/base/hiddenDangerRecord/save';
} else {
url = '/actual/base/hiddenDangerRecord/update';
}
params = {
...this.formData
};
const {
data,
code,
msg
} = await requestPost(url, params);
if (code === 0) {
this.$message.success('操作成功');
this.detailIdcopy = data
// this.handleCancle();
// // this.resetData();
} else if (code >= 8000) {
this.$message.error(msg);
}
},
handleCancle() {
this.resetData();
this.$emit('handleClose');
},
resetData() {
this.$refs.form.resetFields();
},
//
startLoading() {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
});
},
//
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close();
}
},
// init
initMap() {
let {
latitude,
longitude
} = this.$store.state.user;
if (this.formData.latitude && this.formData.longitude) {
latitude = this.formData.latitude;
longitude = this.formData.longitude;
}
if (!latitude || latitude == '' || latitude == '0') {
latitude = 39.9088810666821;
longitude = 116.39743841556731;
}
this.$nextTick(() => {
map = new daiMap(document.getElementById('app_event'), {
latitude,
longitude
}, {
zoom: 16.2, //
pitch: 43.5, //
rotation: 45 //
}
);
//
map.on('dragend', e => {
if (!this.disabled) {
this.handleMoveCenter(e);
});
//
map.on('dragend', e => {
if (!this.disabled) {
this.handleMoveCenter(e);
}
});
map.setCenter(latitude, longitude);
if (this.formData.latitude) {
map.setMarker(latitude, longitude);
}
});
map.setCenter(latitude, longitude);
if (this.formData.latitude) {
map.setMarker(latitude, longitude);
},
async handleMoveCenter() {
//
const {
lat,
lng
} = map.getCenter();
this.formData.latitude = lat;
this.formData.longitude = lng;
map.setMarker(lat, lng);
let {
msg,
data
} = await map.getAddress(lat, lng);
if (msg == 'success') {
this.formData.location = data.address;
this.searchValue = data.address;
this.searchOptions = [];
}
});
},
async handleMoveCenter() {
//
const { lat, lng } = map.getCenter();
this.formData.latitude = lat;
this.formData.longitude = lng;
map.setMarker(lat, lng);
let { msg, data } = await map.getAddress(lat, lng);
if (msg == 'success') {
this.formData.location = data.address;
this.searchValue = data.address;
this.searchOptions = [];
}
},
async remoteMethod(query) {
if (query !== '') {
this.loading = true;
const { msg, data } = await map.searchNearby(query);
this.loading = false;
this.resultList = [];
if (msg == 'success' && data.resultList && data.resultList.length > 0) {
if (data.resultList && data.resultList.length > 0) {
this.resultList = data.resultList;
this.searchOptions = this.resultList.map(item => {
return { value: `${item.id}`, label: `${item.address + item.name}` };
});
}
} else {
this.searchOptions = [
{
},
async remoteMethod(query) {
if (query !== '') {
this.loading = true;
const {
msg,
data
} = await map.searchNearby(query);
this.loading = false;
this.resultList = [];
if (msg == 'success' && data.resultList && data.resultList.length > 0) {
if (data.resultList && data.resultList.length > 0) {
this.resultList = data.resultList;
this.searchOptions = this.resultList.map(item => {
return {
value: `${item.id}`,
label: `${item.address + item.name}`
};
});
}
} else {
this.searchOptions = [{
value: '0',
label: '未检索到结果'
}
];
}];
}
} else {
this.searchOptions = [];
}
} else {
this.searchOptions = [];
}
},
handleClickKey(index) {
let selPosition = this.resultList[index];
let lonlat = selPosition.lonlat.split(' ');
map.setCenter(lonlat[1], lonlat[0]);
map.setMarker(lonlat[1], lonlat[0]);
this.formData.latitude = lonlat[1];
this.formData.longitude = lonlat[0];
this.formData.location = selPosition.address + selPosition.name;
},
// handleImgRemove(file, row) {
// let url = file.url || file.response.data.url;
// if (url) {
// row.imgList = row.imgList.filter(item => item !== url);
// this.computeImgShowList(row);
// }
// },
beforeImgUpload(file) {
const isLt1M = file.size / 1024 / 1024 < 10;
const srcType = file.type;
const format = file.name.split('.').pop();
if (!isLt1M) {
this.$message.error('上传文件大小不能超过 10MB!');
return false;
}
if (srcType.indexOf('image') == -1) {
this.$message.error('仅限图片格式');
return false;
},
handleClickKey(index) {
let selPosition = this.resultList[index];
let lonlat = selPosition.lonlat.split(' ');
map.setCenter(lonlat[1], lonlat[0]);
map.setMarker(lonlat[1], lonlat[0]);
this.formData.latitude = lonlat[1];
this.formData.longitude = lonlat[0];
this.formData.location = selPosition.address + selPosition.name;
},
// handleImgRemove(file, row) {
// let url = file.url || file.response.data.url;
// if (url) {
// row.imgList = row.imgList.filter(item => item !== url);
// this.computeImgShowList(row);
// }
// },
beforeImgUpload(file) {
const isLt1M = file.size / 1024 / 1024 < 10;
const srcType = file.type;
const format = file.name.split('.').pop();
if (!isLt1M) {
this.$message.error('上传文件大小不能超过 10MB!');
return false;
}
if (srcType.indexOf('image') == -1) {
this.$message.error('仅限图片格式');
return false;
}
return true;
}
return true;
}
}
};
};
</script>
<style lang="scss" scoped>
@import '@/assets/scss/modules/management/form-main.scss';
@import '@/assets/scss/modules/management/form.scss';
@import '@/assets/scss/modules/visual/a_customize.scss';
.el-dialog__body {
padding: 30px 80px;
}
</style>
@import '@/assets/scss/modules/management/form-main.scss';
@import '@/assets/scss/modules/management/form.scss';
@import '@/assets/scss/modules/visual/a_customize.scss';
.el-dialog__body {
padding: 30px 80px;
}
</style>

7
src/views/modules/shequzhili/tuceng/anquan/yinhuan/record.vue

@ -27,7 +27,7 @@
<el-select v-if="scope.row.isEdit" v-model="scope.row.handleState" placeholder="请选择" class="input-width" size="small" clearable>
<el-option v-for="subItem in optionResult" :key="subItem.value" :label="subItem.label" :value="subItem.value"></el-option>
</el-select>
<div v-else class="div-content">{{ scope.row.handleState == 1 ? '处理完成' : '待处理' }}</div>
<div v-else class="div-content">{{ scope.row.handleState == 1 ? '处理' : '待处理' }}</div>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" align="center" width="200px">
@ -108,10 +108,7 @@ export default {
tempRow: {},
optionResult: [
{
label: '待处理',
value: '0'
},
{
label: '已处理',
value: '1'

2
src/views/modules/shequzhili/tuceng/zhonghe/shebei/addForm.vue

@ -29,7 +29,7 @@
<el-input v-model="formData.contactNum" :disabled="disabled" class="u-item-width-normal" size="small" clearable placeholder="请输入"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-col :span="18">
<el-form-item label="所处位置" prop="location" style="display: block">
<el-select
v-model="formData.location"

5
src/views/modules/shequzhili/tuceng/zhonghe/shebei/record.vue

@ -54,7 +54,7 @@
</template>
</el-table-column>
<el-table-column prop="inspectResult" label="检查结果" align="center" width="200px">
<el-table-column prop="inspectResult" label="检查结果" align="center" >
<template slot-scope="scope">
<el-select v-if="scope.row.isEdit" v-model="scope.row.inspectResult" placeholder="请选择" class="input-width" size="small" clearable>
<el-option v-for="subItem in optionResult" :key="subItem.value" :label="subItem.label" :value="subItem.value"></el-option>
@ -102,8 +102,7 @@
list-type="picture"
:before-upload="beforeImgUpload"
>
<i class="el-icon-plus avatar-uploader-icon"></i>
最多三张图片
<div v-if="scope.row.imgList.length != 3"><i class="el-icon-plus avatar-uploader-icon"></i> 最多三张图片</div>
</el-upload>
</div>

Loading…
Cancel
Save