zhangqun 11 months ago
parent 4f55cff1a7
commit 5de589a292
  1. 3
      common/globalJs/globalJs.js
  2. 4
      manifest.json
  3. 2
      pages/investigation/components/investigation-item.vue
  4. 856
      pages/investigation/components/investigation-item2.vue
  5. 30
      pages/investigation/components/problem-tree-item.vue
  6. 238
      pages/investigation/task.vue
  7. 105
      pages/map/index.vue

@ -2,7 +2,8 @@
// #ifdef APP-PLUS || MP // #ifdef APP-PLUS || MP
// const baseUrl = "http://116.62.210.143:9002"; // const baseUrl = "http://116.62.210.143:9002";
// const baseUrl = "http://118.89.79.160:8800/HiatmpPro"; // const baseUrl = "http://118.89.79.160:8800/HiatmpPro";
const baseUrl = "http://219.147.31.25:30001/tht-app-api/HiatmpPro"; const baseUrl = "http://49.235.207.167:8800/HiatmpPro";
// const baseUrl = "http://219.147.31.25:30001/tht-app-api/HiatmpPro";
const chatUrl = "http://219.147.31.25:30001/hitap"; const chatUrl = "http://219.147.31.25:30001/hitap";
// #endif // #endif
// #ifdef H5 // #ifdef H5

@ -135,8 +135,8 @@
"https" : false, "https" : false,
"proxy" : { "proxy" : {
"/HiatmpPro" : { "/HiatmpPro" : {
// "target" : "http://118.89.79.160:8800", "target" : "http://49.235.207.167:8800",
"target" : "http://219.147.31.25:30001/tht-app-api", // "target" : "http://219.147.31.25:30001/tht-app-api",
"changeOrigin" : true, "changeOrigin" : true,
"secure" : false, "secure" : false,
"pathRewrite" : { "pathRewrite" : {

@ -197,7 +197,7 @@
}, },
investigationDetailHandle() { investigationDetailHandle() {
this.showInvestigationDetail = false this.showInvestigationDetail = false
this.$emit('select', this.investigationList[this.investigationSelect], this.investigationDetailList) this.$emit('select', this.investigationList[this.investigationSelect], this.investigationDetailList, this.investigationList[this.investigationSelect])
} }
}, },
onReady() { }, onReady() { },

@ -1,364 +1,530 @@
<template> <template>
<view> <view>
<view class="custom-pop-head">
<view class="custom-pop-head"> <view class="left" @click="$emit('show', false)">取消</view>
<view class="left" @click="$emit('show',false)">取消</view> <view class="title">{{ investigationDetailTitle }}</view>
<view class="title">{{ investigationDetailTitle }}</view> <view class="right" @click="investigationDetailHandle">确认</view>
<view class="right" @click="investigationDetailHandle">确认</view> </view>
</view> <view class="box" style="max-height: 800rpx; overflow-y: auto">
<view class="box" style="max-height: 800rpx;overflow-y: auto"> <view
<view class="investigation-item" v-for="(item, index) in investigationDetailList" :key="index" class="investigation-item"
style="width: 96%; padding: 0"> v-for="(item, index) in investigationDetailList"
<view class="detail-item" v-if="item.type === 'number' || item.type === '1'"> :key="index"
<uni-forms-item :label="item.name" label-width="450rpx" style="display: flex;align-items: center"> style="width: 96%; padding: 0"
<u-input placeholder="请输入" border="none" v-model="item.standar" inputAlign="right" >
type="number"> <view
<u-text :text="item.unit" slot="suffix" margin="0 3px 0 0" type="tips"></u-text> class="detail-item"
</u-input> v-if="item.type === 'number' || item.type === '1'"
</uni-forms-item> >
</view> <uni-forms-item
<view class="detail-item" v-else-if="item.type === 'text' || item.type === '2'"> :label="item.name"
<uni-forms-item :label="item.name" label-width="450rpx" style="display: flex;align-items: center"> label-width="450rpx"
<u-input placeholder="请输入" border="none" v-model="item.standar" inputAlign="right" /> style="display: flex; align-items: center"
</uni-forms-item> >
</view> <u-input
<view class="detail-item" v-else-if="item.type === 'check' || item.type === '3'"> placeholder="请输入"
<uni-forms-item :label="item.name" label-width="450rpx" style="display: flex;align-items: center"> border="none"
<u-checkbox v-model="item.standar" :customStyle="{justifyContent: 'space-between'}" v-model="item.standar"
:name="'sdfs'" /> inputAlign="right"
</uni-forms-item> type="number"
</view> >
<view class="detail-item" v-else-if="item.type === 'upload' || item.type === '4'"> <u-text
<uni-forms-item :label="item.name" label-position="top" label-width="450rpx" :text="item.unit"
style="display: flex;align-items: center" /> slot="suffix"
<u-upload :fileList="item.fileList" @afterRead="(e) => afterRead(e, item)" margin="0 3px 0 0"
@delete="(e) => deletePic(e, item)" name="1" :maxCount="1"></u-upload> type="tips"
</view> ></u-text>
</view> </u-input>
<view class="detail-item"> </uni-forms-item>
<uni-forms-item label="隐患描述" label-position="top" label-width="200px" /> </view>
<u-textarea placeholder="请输入" border="none" v-model="formData.hdDesc" /> <view
</view> class="detail-item"
<view class="detail-item"> v-else-if="item.type === 'text' || item.type === '2'"
<uni-forms-item label="隐患图片" label-position="top" label-width="200px" /> >
<u-upload :fileList="fileList" @afterRead="(e) => afterRead2(e, 'fileList')" <uni-forms-item
@delete="(e) => deletePic2(e, 'fileList')" name="1" :maxCount="1"></u-upload> :label="item.name"
</view> label-width="450rpx"
<view class="detail-item"> style="display: flex; align-items: center"
<uni-forms-item label="需采集补充信息" label-position="top" label-width="200px" /> >
<u-textarea placeholder="请输入" border="none" v-model="formData.hdInfo" /> <u-input
</view> placeholder="请输入"
</view> border="none"
<view class="blank" /> v-model="item.standar"
</view> inputAlign="right"
/>
</uni-forms-item>
</view>
<view
class="detail-item"
v-else-if="item.type === 'check' || item.type === '3'"
>
<uni-forms-item
:label="item.name"
label-width="450rpx"
style="display: flex; align-items: center"
>
<u-checkbox
v-model="item.standar"
:customStyle="{ justifyContent: 'space-between' }"
:name="'sdfs'"
/>
</uni-forms-item>
</view>
<view
class="detail-item"
v-else-if="item.type === 'upload' || item.type === '4'"
>
<uni-forms-item
:label="item.name"
label-position="top"
label-width="450rpx"
style="display: flex; align-items: center"
/>
<u-upload
:fileList="item.fileList"
@afterRead="(e) => afterRead(e, item)"
@delete="(e) => deletePic(e, item)"
name="1"
:maxCount="1"
></u-upload>
</view>
</view>
<view class="investigation-item" style="width: 96%; padding: 0">
<view class="detail-item">
<uni-forms-item
label="隐患描述"
label-position="top"
label-width="200px"
/>
<u-textarea
placeholder="请输入"
border="none"
v-model="formData.hdDesc"
/>
</view>
</view>
<view class="investigation-item" style="width: 96%; padding: 0">
<view class="detail-item">
<uni-forms-item
label="隐患图片"
label-position="top"
label-width="200px"
/>
<u-upload
:fileList="fileList"
@afterRead="(e) => afterRead2(e, 'fileList')"
@delete="(e) => deletePic2(e, 'fileList')"
name="1"
:maxCount="1"
></u-upload>
</view>
</view>
<view class="investigation-item" style="width: 96%; padding: 0">
<view class="detail-item">
<uni-forms-item
label="需采集补充信息"
label-position="top"
label-width="200px"
/>
<u-textarea
placeholder="请输入"
border="none"
v-model="formData.hdInfo"
/>
</view>
</view>
</view>
<view class="blank" />
</view>
</template> </template>
<script> <script>
export default { export default {
// //
components: {}, components: {},
props: { props: {
sid: { sid: {
type: String, type: String,
default: '01' default: "01",
}, },
json: { json: {
type: Object, type: Object,
default: {} default: {},
}, },
}, businessId: {
data() { type: String,
return { default: "",
// js },
$: this.$, },
investigationSelect: null, data() {
investigationList: [], return {
showInvestigationDetail: false, // js
investigationDetailTitle: '', $: this.$,
investigationDetailList: [], investigationSelect: null,
formData: { investigationList: [],
bigCategory: '', showInvestigationDetail: false,
smallCategory: '', investigationDetailTitle: "",
hdTerm: '', investigationDetailList: [],
hdPic: '', formData: {
hdDesc: '', // bigCategory: '',
hdInfo: '', // smallCategory: '',
}, // hdTerm: '',
fileList: [], hdPic: "",
} hdDesc: "",
}, hdInfo: "",
// },
onLoad(e) { fileList: [],
// this.getData() };
}, },
mounted() { //
onLoad(e) {
if (this.json.name) { // this.getData()
this.investigationDetailList = this.json.extraConfigs.map(item => { },
if (!item.fileList) { mounted() {
item.fileList = [] console.log(this.json);
} if (this.json.extraConfigs) {
switch (item.type) { this.investigationDetailList = this.json.extraConfigs.map((item) => {
// case "1": if (!item.fileList) {
// item.standar = 0 item.fileList = [];
// break; }
// case "2": switch (
// item.standar = '' item.type
// break; // case "1":
// case "3": // item.standar = 0
// item.standar = false // break;
// break; // case "2":
// case "4": // item.standar = ''
// item.fileList = [ // break;
// { // case "3":
// "id": "20229a8c-db46-4447-be3e-6731665f7bd0", // item.standar = false
// "type": "image", // break;
// "url": "https://img-blog.csdnimg.cn/20210823085628540.jpeg", // case "4":
// "thumb": "blob:http://localhost:8080/4343e24a-edc5-4693-8fbd-f99647ea3bd5", // item.fileList = [
// "size": 11600, // // {
// "name": ".png", // // "id": "20229a8c-db46-4447-be3e-6731665f7bd0",
// "status": "success", // // "type": "image",
// "message": "", // // "url": "https://img-blog.csdnimg.cn/20210823085628540.jpeg",
// "result": { // // "thumb": "blob:http://localhost:8080/4343e24a-edc5-4693-8fbd-f99647ea3bd5",
// "code": 200, // // "size": 11600,
// "message": "", // // "name": ".png",
// "result": "https://img-blog.csdnimg.cn/20210823085628540.jpeg" // // "status": "success",
// } // // "message": "",
// } // // "result": {
// ] // // "code": 200,
// break; // // "message": "",
} // // "result": "https://img-blog.csdnimg.cn/20210823085628540.jpeg"
return item // // }
}) // // }
} // ]
}, // break;
// ) {
onShow() { }, }
// return item;
computed: {}, });
// } else {
methods: { this.getData();
}
// if (this.json.checkedSelect) {
deletePic(event, item) { this.formData = {
item.fileList.splice(event.index, 1) hdPic: this.json.checkedSelect.hdPic || "",
}, hdDesc: this.json.checkedSelect.hdDesc || "",
//id hdInfo: this.json.checkedSelect.hdInfo || "",
uuid(len, binary) { };
len = !len ? 36 : len; }
binary = !binary ? 16 : binary; },
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { //
var r = Math.random() * binary | 0, onShow() {},
v = c == 'x' ? r : (r & 0x3 | 0x8); //
return v.toString(binary); computed: {},
}).substring(0, len) //
}, methods: {
// //
async afterRead(event, item) { deletePic(event, item) {
item.fileList.splice(event.index, 1);
// multiple true , file },
const id = this.uuid() //id
item.fileList.push({ uuid(len, binary) {
id, len = !len ? 36 : len;
...event.file, binary = !binary ? 16 : binary;
status: 'uploading', return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
message: '上传中' .replace(/[xy]/g, function (c) {
}) var r = (Math.random() * binary) | 0,
const result = await this.uploadFilePromise(item.fileList[0].url) v = c == "x" ? r : (r & 0x3) | 0x8;
const resultInfo = JSON.parse(result) return v.toString(binary);
const index = item.fileList.findIndex(v => v.id === id) })
if (resultInfo.code == 200) { .substring(0, len);
item.fileList.splice(index, 1, Object.assign(item.fileList[index], { },
status: 'success', //
message: '', async afterRead(event, item) {
result: resultInfo, // multiple true , file
url: resultInfo.result const id = this.uuid();
})) item.fileList.push({
} else { id,
this.$.toast('上传失败') ...event.file,
item.fileList.splice(index, 1, Object.assign(item.fileList[index], { status: "uploading",
status: 'error', message: "上传中",
message: '失败', });
})) const result = await this.uploadFilePromise(item.fileList[0].url);
} const resultInfo = JSON.parse(result);
}, const index = item.fileList.findIndex((v) => v.id === id);
uploadFilePromise(url) { if (resultInfo.code == 200) {
return new Promise((resolve, reject) => { item.fileList.splice(
let a = uni.uploadFile({ index,
url: this.$.baseUrl + '/hiddenDanger/ftp/uploadFileToFtp', // 1,
filePath: url, Object.assign(item.fileList[index], {
name: 'file', status: "success",
success: (res) => { message: "",
resolve(res.data) result: resultInfo,
} url: resultInfo.result,
}); })
}) );
}, } else {
// this.$.toast("上传失败");
deletePic2(event, key) { item.fileList.splice(
this[key].splice(event.index, 1) index,
this.formData.hdPic = this[key].filter(item => item.status === 'success').map(item => item.url).toString() 1,
this.changeEmit() Object.assign(item.fileList[index], {
}, status: "error",
// message: "失败",
async afterRead2(event, key) { })
// multiple true , file );
const id = this.uuid() }
this[key].push({ },
id, uploadFilePromise(url) {
...event.file, return new Promise((resolve, reject) => {
status: 'uploading', let a = uni.uploadFile({
message: '上传中' url: this.$.baseUrl + "/hiddenDanger/ftp/uploadFileToFtp", //
}) filePath: url,
const result = await this.uploadFilePromise(this[key][0].url) name: "file",
const resultInfo = JSON.parse(result) success: (res) => {
const index = this[key].findIndex(v => v.id === id) resolve(res.data);
if (resultInfo.code == 200) { },
this[key].splice(index, 1, Object.assign(this[key][index], { });
status: 'success', });
message: '', },
result: resultInfo, //
url: resultInfo.result deletePic2(event, key) {
})) this[key].splice(event.index, 1);
} else { this.formData.hdPic = this[key]
this.$.toast('上传失败') .filter((item) => item.status === "success")
this[key].splice(index, 1, Object.assign(this[key][index], { .map((item) => item.url)
status: 'error', .toString();
message: '失败', this.changeEmit();
})) },
} //
this.formData.hdPic = this[key].filter(item => item.status === 'success').map(item => item.url).toString() async afterRead2(event, key) {
this.changeEmit() // multiple true , file
}, const id = this.uuid();
changeEmit() { this[key].push({
this.$emit('change', this.formData) id,
}, ...event.file,
getData() { status: "uploading",
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangerInfo', { message: "上传中",
sid: this.$props.sid });
}, 'GET').then(res => { const result = await this.uploadFilePromise(this[key][0].url);
if (res.code == 200) { const resultInfo = JSON.parse(result);
this.investigationDetailList = res.result.map(item => { const index = this[key].findIndex((v) => v.id === id);
switch (item.type) { if (resultInfo.code == 200) {
case "1": this[key].splice(
item.standar = 0 index,
break; 1,
case "2": Object.assign(this[key][index], {
item.standar = '' status: "success",
break; message: "",
case "3": result: resultInfo,
item.standar = false url: resultInfo.result,
break; })
case "4": );
item.fileList = [] } else {
break; this.$.toast("上传失败");
} this[key].splice(
return item index,
}) 1,
} Object.assign(this[key][index], {
}) status: "error",
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangers', {}, 'GET').then(res => { message: "失败",
if (res.code == 200) { })
this.investigationList = res.result );
} }
}) this.formData.hdPic = this[key]
}, .filter((item) => item.status === "success")
// .map((item) => item.url)
skipPage(even) { .toString();
this.$.open(even) this.changeEmit();
}, },
handleSelect(item, index) { changeEmit() {
this.investigationSelect = index this.$emit("change", this.formData);
this.investigationDetailTitle = item.name },
this.showInvestigationDetail = true getData2() {
// this.$emit('select', this.investigationSelect, this.investigationList[index]) this.$request
}, .globalRequest(
investigationDetailHandle() { "/hiddenDanger/highDanger/getImportDangerInfo",
// this.$emit('select', this.json) {
} sid: this.$props.json.nid,
}, },
onReady() { }, "GET"
// )
onUnload() { .then((res) => {
if (res.code == 200) {
}, this.investigationDetailList = res.result.map((item) => {
// switch (item.type) {
onPullDownRefresh() { case "1":
// item.standar = 0;
setTimeout(() => { break;
uni.stopPullDownRefresh(); case "2":
}, 1500); item.standar = "";
}, break;
// case "3":
onReachBottom() { }, item.standar = false;
} break;
case "4":
item.fileList = [];
break;
}
return item;
});
}
});
// this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangers', {}, 'GET').then(res => {
// if (res.code == 200) {
// this.investigationList = res.result
// }
// })
},
getData() {
this.$request
.globalRequest(
"/hiddenDanger/highDanger/getImportDangerDisplayDetail",
{
dangerId: this.$props.json.id,
businessId: this.$props.businessId,
},
"GET"
)
.then((res) => {
if (res.code == 200) {
if (res.result.length > 0) {
this.investigationDetailList = res.result.map((item) => {
switch (item.type) {
case "1":
item.standar = 0;
break;
case "2":
item.standar = "";
break;
case "3":
item.standar = false;
break;
case "4":
item.fileList = [];
break;
}
return item;
});
} else {
this.getData2();
}
}
});
},
//
skipPage(even) {
this.$.open(even);
},
handleSelect(item, index) {
this.investigationSelect = index;
this.investigationDetailTitle = item.name;
this.showInvestigationDetail = true;
// this.$emit('select', this.investigationSelect, this.investigationList[index])
},
investigationDetailHandle() {
this.$emit("select", {
...this.json,
checkedSelect: this.formData,
extraConfigs: this.investigationDetailList,
});
},
},
onReady() {},
//
onUnload() {},
//
onPullDownRefresh() {
//
setTimeout(() => {
uni.stopPullDownRefresh();
}, 1500);
},
//
onReachBottom() {},
};
</script> </script>
<style> <style>
page { page {
background: #FFFFFF; background: #ffffff;
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.investigation-item { .investigation-item {
margin: 0 auto 20rpx; margin: 0 auto 20rpx;
width: 90%; width: 90%;
border-radius: 8rpx; border-radius: 8rpx;
padding: 20rpx; padding: 20rpx;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
overflow: hidden; overflow: hidden;
&.active { &.active {
background: #DFEBF8; background: #dfebf8;
} }
} }
.detail-item { .detail-item {
width: 100%; width: 100%;
background: #F0F3F7; background: #f0f3f7;
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
border-radius: 8rpx; border-radius: 8rpx;
box-sizing: border-box; box-sizing: border-box;
/deep/ .uni-forms-item__content { /deep/ .uni-forms-item__content {
justify-content: flex-end; justify-content: flex-end;
text-align: right; text-align: right;
display: flex; display: flex;
} }
/deep/ .uni-forms-item { /deep/ .uni-forms-item {
margin-bottom: 0; margin-bottom: 0;
} }
/deep/ .uni-forms-item__label { /deep/ .uni-forms-item__label {
font-size: 32rpx; font-size: 32rpx;
// height:82rpx // height:82rpx
} }
} }
.custom-pop-head { .custom-pop-head {
width: 100%; width: 100%;
padding: 20rpx; padding: 20rpx;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
border-bottom: 1px solid #E6E6E6; border-bottom: 1px solid #e6e6e6;
margin-bottom: 20rpx; margin-bottom: 20rpx;
.left { .left {
color: #666666; color: #666666;
} }
.title { .title {
font-size: 16px; font-size: 16px;
} }
.right { .right {
color: #2663BF; color: #2663bf;
} }
} }
</style> </style>

@ -19,14 +19,15 @@
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<scroll-view style="max-height: 400px;" :scroll-top="0" scroll-y="true" show-scrollbar="true">
<view <view
class="investigation-item" class="investigation-item"
:class="problemTreeSelect === item.id ? 'active' : ''" :class="problemTreeSelect === item.id ? 'active' : ''"
v-for="(item, index) in problemTreeSelectList" v-for="(item, index) in 50"
:key="item.itemname" :key="item.itemname"
@click="handleSelectProblem(item, index)" @click="handleSelectProblem(item, index)"
> >
<text>{{ item.itemname }}</text> <text>{{ item.itemname }}</text>111
<uni-icons <uni-icons
type="checkmarkempty" type="checkmarkempty"
size="24" size="24"
@ -36,6 +37,7 @@
}" }"
/> />
</view> </view>
</scroll-view>
</view> </view>
</template> </template>
@ -176,4 +178,28 @@ page {
overflow-x: auto; overflow-x: auto;
flex-wrap: nowrap; flex-wrap: nowrap;
} }
::v-deep ::-webkit-scrollbar {
//
display: block;
width: 20rpx !important;
height: 20rpx !important;
-webkit-appearance: auto !important;
background: transparent;
overflow: auto !important;
}
::v-deep ::-webkit-scrollbar-thumb {
//
border-radius: 20rpx !important;
box-shadow: inset 0 0 5rpx rgba(0, 0, 0, 0.2) !important;
background-color: #f7f7f7 !important;
}
::v-deep ::-webkit-scrollbar-track {
//
border-radius: 20rpx !important;
box-shadow: inset 0 0 5rpx rgba(0, 0, 0, 0.2) !important;
background-color: #dad8d8 !important;
}
</style> </style>

@ -48,7 +48,7 @@
<uni-forms-item label="车辆数"> <uni-forms-item label="车辆数">
<input v-if="isEdit" type="number" class="BorderNone Height100" v-model="formData.laneCount" <input v-if="isEdit" type="number" class="BorderNone Height100" v-model="formData.laneCount"
placeholder="请输入车辆数" /> placeholder="请输入车辆数" />
<text class="Height100 Flex Flex_end Flex_C_S-Center" v-else>{{ formData.laneCount }}车道</text> <text class="Height100 Flex Flex_end Flex_C_S-Center" v-else>{{ formData.laneCount }}</text>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="路面结构"> <uni-forms-item label="路面结构">
<input v-if="isEdit" type="text" class="BorderNone Height100" v-model="formData.roadStructure" <input v-if="isEdit" type="text" class="BorderNone Height100" v-model="formData.roadStructure"
@ -135,7 +135,8 @@
<view class="title">重点排查</view> <view class="title">重点排查</view>
<view class='row' style="display: flex; flex-wrap: wrap; justify-content: space-between;"> <view class='row' style="display: flex; flex-wrap: wrap; justify-content: space-between;">
<view style="width: 300rpx;" v-for="item in investigationSelectList" :key="item" <view style="width: 300rpx;" v-for="item in investigationSelectList" :key="item"
@click="showInvestigationTag(item)"> >
<view class="item">{{ item.name }}</view> <view class="item">{{ item.name }}</view>
</view> </view>
<view style="width: 300rpx;"> <view style="width: 300rpx;">
@ -147,14 +148,14 @@
</view> </view>
</view> </view>
<u-checkbox-group v-model="checked" iconPlacement="right" placement="row"> <u-checkbox-group v-model="checked" iconPlacement="right" placement="row">
<u-checkbox v-for="(item,index) in troubleshootingData" :label="item.itemname" activeColor="#2663BF" <u-checkbox v-for="(item,index) in troubleshootingData" :key="index" :label="item.itemname" activeColor="#2663BF"
:name="item.id"></u-checkbox> :name="item.id" @click="showInvestigationTag2(item)"></u-checkbox>
</u-checkbox-group> </u-checkbox-group>
<u-popup :show="showInvestigation" @close="showInvestigation = false"> <u-popup :show="showInvestigation" @close="showInvestigation = false">
<InvestigationItem @select="select2"></InvestigationItem> <InvestigationItem @select="select2"></InvestigationItem>
</u-popup> </u-popup>
<u-popup :show="showInvestigation2" @close="showInvestigation2 = false"> <u-popup :show="showInvestigation2" @close="showInvestigation2 = false">
<InvestigationItem2 :json="showInvestigation2Item" @show="showInvestigation2 = false" <InvestigationItem2 :json="showInvestigation2Item" :businessId="this.businessId" @show="showInvestigation2 = false"
@select="select3"></InvestigationItem2> @select="select3"></InvestigationItem2>
</u-popup> </u-popup>
<!-- <u-popup :show="showInvestigation" @close="showInvestigation = false"> <!-- <u-popup :show="showInvestigation" @close="showInvestigation = false">
@ -215,7 +216,9 @@
<view class="formBox form-step-3" v-if="active === 3"> <view class="formBox form-step-3" v-if="active === 3">
<view class="point"> <view class="point">
<view class="title">存在隐患</view> <view class="title">存在隐患</view>
<u-row :gutter="0" justify="flex-start" style="flex-wrap: wrap"> <u-row :gutter="0" justify="flex-start" style="flex-wrap: wrap">
<scroll-view style="max-height: 400px;" :scroll-top="0" scroll-y="true" show-scrollbar="true">
<view v-for="(item,index) in hiddenDangerList" :key="item" style="width: 100%"> <view v-for="(item,index) in hiddenDangerList" :key="item" style="width: 100%">
<view class="problem-item"> <view class="problem-item">
<view style="display: flex; justify-content: space-between"> <view style="display: flex; justify-content: space-between">
@ -238,6 +241,8 @@
<view class="text">{{ item.hdDesc }}</view> <view class="text">{{ item.hdDesc }}</view>
</view> </view>
</view> </view>
</scroll-view>
<u-col :span="12"> <u-col :span="12">
<view class="problem-item add" @click="add"> <view class="problem-item add" @click="add">
<uni-icons type="plusempty" size="24" style="margin-right: 10rpx; color: #2663bf" /> <uni-icons type="plusempty" size="24" style="margin-right: 10rpx; color: #2663bf" />
@ -420,13 +425,13 @@
], ],
formData: { formData: {
roadType: "", roadType: "",
roadWidth: 0, roadWidth: "",
laneCount: 0, laneCount: "",
roadStructure: "", roadStructure: "",
sideProtec: "", sideProtec: "",
centerSeparate: "", centerSeparate: "",
designSpeed: 0, designSpeed: "",
limitSpeed: 0, limitSpeed: "",
}, },
describe: { describe: {
bigCategory: "", bigCategory: "",
@ -525,21 +530,16 @@
this.showInvestigation2 = true; this.showInvestigation2 = true;
this.showInvestigation2Item = v; this.showInvestigation2Item = v;
}, },
select2(v, list) {
// this.showInvestigation = false; showInvestigationTag2(v){
// let id = 0; console.log(v, this.investigationSelectList)
// this.investigationSelectList.map((r) => { if(this.checked.includes(v.id)){
// if (r.nid == v.nid) { this.showInvestigation2 = true;
// id = r.nid; this.showInvestigation2Item = v
// } }
// });
// if (!id) { },
// v.extraConfigs = list; select2(v, list, list2) {
// this.investigationSelectList.push(v);
// this.showInvestigation = false;
// } else {
// this.$.toast("");
// }
list.dangerItems.forEach(item => { list.dangerItems.forEach(item => {
// this.troubleshootingDataitem.idid // this.troubleshootingDataitem.idid
let found = false; let found = false;
@ -563,16 +563,64 @@
let isId = this.investigationSelectList.some(item => item.nid === list.nid); let isId = this.investigationSelectList.some(item => item.nid === list.nid);
if (!isId) { if (!isId) {
this.investigationSelectList.push(list) this.investigationSelectList.push(list)
} else {
this.$.toast("已添加");
} }
// this.showInvestigation = false;
// let id = 0;
// this.investigationSelectList.map((r) => {
// if (r.nid == v.nid) {
// id = r.nid;
// }
// });
// if (!id) {
// v.extraConfigs = list;
// this.investigationSelectList.push(v);
// this.showInvestigation = false;
// list2.dangerItems.forEach(item => {
// // this.troubleshootingDataitem.idid
// let found = false;
// // this.troubleshootingDataid
// this.troubleshootingData.forEach(item2 => {
// if (item.id === item2.id) {
// // foundtrue退
// found = true;
// return;
// }
// });
// // this.troubleshootingDataidresult
// if (!found) {
// this.troubleshootingData.push(item);
// }
// });
// // this.troubleshootingData = result
// // let isId = this.investigationSelectList.some(item => item.nid === list.nid);
// // if (!isId) {
// // this.investigationSelectList.push(list)
// // }
// } else {
// this.$.toast("");
// }
}, },
select3(v) { select3(v) {
this.investigationSelectList.map((r) => { // this.investigationSelectList.map((r) => {
if (r.nid == v.nid) { // if (r.nid == v.nid) {
r = v; // r = v;
} // }
}); // });
console.log(v)
this.showInvestigation2Item = {}; this.showInvestigation2Item = {};
this.showInvestigation2 = false; this.showInvestigation2 = false;
this.troubleshootingData.map(r => {
if(r.id == v.id){
r.checkedSelect = v.checkedSelect
r.extraConfigs = v.extraConfigs
}
})
}, },
onHiddenDangerList(v, index) { onHiddenDangerList(v, index) {
this.addInvestigationInfo = { this.addInvestigationInfo = {
@ -660,6 +708,11 @@
) )
.then((res) => { .then((res) => {
if (res.code === 200) { if (res.code === 200) {
for(let k in res.result){
if(res.result[k] == 0) {
res.result[k] = ""
}
}
this.formData = { this.formData = {
...this.formData, ...this.formData,
...res.result ...res.result
@ -695,27 +748,36 @@
if (res.code === 200) { if (res.code === 200) {
// todo // todo
this.investigationSelectList = res.result; this.investigationSelectList = res.result;
this.$request this.investigationSelectList.map((r) => {
.globalRequest(
"/hiddenDanger/highDanger/getImportDangerDisplayDetail", { this.troubleshootingData = [...this.troubleshootingData,...r.dangerItems]
nuserid: this.$.getData("token"), });
businessId, this.checked = this.troubleshootingData.map(r => {
dangerId: '26' if(r.checked == 1){
}, return r.id
"GET" }
) })
.then((res) => { // this.$request
if (res.code === 200) { // .globalRequest(
this.investigationSelectList.map((r) => { // "/hiddenDanger/highDanger/getImportDangerDisplayDetail", {
r.extraConfigs = []; // nuserid: this.$.getData("token"),
res.result.map((m) => { // businessId,
if (r.nid == m.scenesId) { // dangerId: '26'
r.extraConfigs.push(m); // },
} // "GET"
}); // )
}); // .then((res) => {
} // if (res.code === 200) {
}); // this.investigationSelectList.map((r) => {
// r.extraConfigs = [];
// res.result.map((m) => {
// if (r.nid == m.scenesId) {
// r.extraConfigs.push(m);
// }
// });
// });
// }
// });
} }
}); });
this.$request this.$request
@ -930,25 +992,22 @@
} }
}, },
submit(temporary) { submit(temporary) {
// console.log(this.formData);
// console.log(this.investigationSelectList); let checkedArr = this.troubleshootingData.filter(r => this.checked.includes(r.id))
// console.log({ console.log(checkedArr)
// ...this.formData,
// businessId: this.businessId,
// extraConfigs: extraConfigs,
// describe: this.hiddenDangerList,
// temporary,
// });
let extraConfigs = []; let extraConfigs = [];
this.investigationSelectList.map((r) => { checkedArr.map((r) => {
if(!r.extraConfigs) return
r.extraConfigs.map((s) => { r.extraConfigs.map((s) => {
s.scenesId = r.nid; s.scenesId = r.nid;
s.dangerId = r.id;
if (s.type == 4) { if (s.type == 4) {
s.standar = s.standar =
s.fileList && s.fileList.length > 0 ? s.fileList[0].url : ""; s.fileList && s.fileList.length > 0 ? s.fileList[0].url : "";
} }
s.fileList = ""; delete s.fileList;
s.nid = ""; delete s.nid;
extraConfigs.push(s); extraConfigs.push(s);
}); });
}); });
@ -967,11 +1026,30 @@
if (item.dangerProblem) { if (item.dangerProblem) {
delete item.dangerProblem delete item.dangerProblem
} }
item.pcType = 2
} }
} catch (e) { } catch (e) {
//TODO handle the exception //TODO handle the exception
} }
checkedArr.map(r =>{
describe.push({
hdTerm: r.id,
hdDesc: r.checkedSelect ? r.checkedSelect.hdDesc : '',
hdPic: r.checkedSelect ? r.checkedSelect.hdPic : '',
hdInfo: r.checkedSelect ? r.checkedSelect.hdPic : '',
pcType:1
})
})
console.log(this.investigationSelectList);
console.log(this.troubleshootingData);
console.log({
...this.formData,
businessId: this.businessId,
extraConfigs: extraConfigs,
describe: describe,
});
this.$request this.$request
.globalRequest( .globalRequest(
"/hiddenDanger/highDanger/saveManualInvestigation", { "/hiddenDanger/highDanger/saveManualInvestigation", {
@ -998,11 +1076,11 @@
console.log(res); console.log(res);
if (res.code === 200) { if (res.code === 200) {
this.$.toast("保存成功"); this.$.toast("保存成功");
// setTimeout(() => { setTimeout(() => {
// uni.navigateBack({ uni.navigateBack({
// delta: 2, // 1 delta: 2, // 1
// }); });
// }, 1000); }, 1000);
// this.data = res.result; // this.data = res.result;
// this.rname = this.data[0].name; // this.rname = this.data[0].name;
@ -1315,4 +1393,28 @@
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
} }
::v-deep ::-webkit-scrollbar {
//
display: block;
width: 16rpx !important;
height: 16rpx !important;
-webkit-appearance: auto !important;
background: transparent;
overflow: auto !important;
}
::v-deep ::-webkit-scrollbar-thumb {
//
border-radius: 16rpx !important;
box-shadow: inset 0 0 5rpx rgba(0, 0, 0, 0.2) !important;
background-color: #f7f7f7 !important;
}
::v-deep ::-webkit-scrollbar-track {
//
border-radius: 16rpx !important;
box-shadow: inset 0 0 5rpx rgba(0, 0, 0, 0.2) !important;
background-color: #dad8d8 !important;
}
</style> </style>

@ -147,20 +147,25 @@
:style="ftype == 1 ? 'margin-top: 18px' : 'margin-top: 80px'" :style="ftype == 1 ? 'margin-top: 18px' : 'margin-top: 80px'"
> >
<view @click="onJump(3)" class="btn btn6"> 取消 </view> <view @click="onJump(3)" class="btn btn6"> 取消 </view>
<view @click="handleSubmit" class="btn btn7"> 确定 </view> <view @click="handleSubmit" class="btn btn7"> 确定 {{ show }}</view>
</view> </view>
</view> </view>
<u-modal
:show="show" <cover-view class="umodal" v-show="show">
content="新增成功" <cover-view class="umodal-box">
confirm-text="人工排查" <cover-view class="umodal-content"> 新增成功</cover-view>
cancel-text="智能排查" <cover-view class="umodal-line1"></cover-view>
:showConfirmButton="true" <cover-view class="umodal-btnbox">
:showCancelButton="true" <cover-view class="umodal-btn" @click="handleCheck(2)">
@confirm="handleCheck(2)" 人工排查
@cancel="handleCheck(1)" </cover-view>
:closeOnClickOverlay="false" <cover-view class="umodal-line2"></cover-view>
></u-modal> <cover-view class="umodal-btn" @click="handleCheck(1)">
智能排查
</cover-view>
</cover-view>
</cover-view>
</cover-view>
</view> </view>
</template> </template>
<script> <script>
@ -340,7 +345,7 @@ export default {
console.log(res); console.log(res);
if (res.code === 200) { if (res.code === 200) {
this.data = res.result; this.data = res.result;
this.pageType2Result = this.data[0] this.pageType2Result = this.data[0];
this.rname = this.data[0].name; this.rname = this.data[0].name;
this.polyline = [ this.polyline = [
{ {
@ -374,7 +379,8 @@ export default {
handleCheck(v) { handleCheck(v) {
this.show = false; this.show = false;
if (v == 1) { if (v == 1) {
let json = this.pageType == 1 ? this.pageType1Result : this.pageType2Result; let json =
this.pageType == 1 ? this.pageType1Result : this.pageType2Result;
// let json = { // let json = {
// name: "023", // name: "023",
// operator: "admin1", // operator: "admin1",
@ -413,7 +419,6 @@ export default {
} else { } else {
address = `${this.name1}${this.name4}`; address = `${this.name1}${this.name4}`;
} }
this.$request this.$request
.globalRequest( .globalRequest(
"/hiddenDanger/highDanger/saveSectionOrCrossing", "/hiddenDanger/highDanger/saveSectionOrCrossing",
@ -448,11 +453,24 @@ export default {
}); });
}, },
onList(e, i) { onList(e, i) {
console.log(e);
this.pageType = 2; this.pageType = 2;
this.idx = i; this.idx = i;
this.pageType2Result = e this.pageType2Result = e;
if (e && e.name && e.position) { if (e && e.name && e.position) {
this.rname = e.name; this.rname = e.name;
this.longitude = e.position[0].longitude;
this.latitude = e.position[0].latitude;
this.covers = [
{
id: "markers1",
latitude: e.position[0].latitude,
longitude: e.position[0].longitude,
iconPath: "/static/icon/fill_position.svg",
width: 24, //
height: 28, //
},
];
this.polyline = [ this.polyline = [
{ {
name: "xian1", name: "xian1",
@ -598,7 +616,7 @@ export default {
top: calc(50vh + 70px); top: calc(50vh + 70px);
background: #fff; background: #fff;
border-radius: 16px; border-radius: 16px;
z-index: 99998; z-index: 99998;
cover-image { cover-image {
width: 32px; width: 32px;
height: 32px; height: 32px;
@ -866,4 +884,57 @@ export default {
} }
} }
} }
.umodal {
position: absolute;
width: 100%;
height: 100vh;
top: 0;
left: 0;
z-index: 99999;
background: rgba(0, 0, 0, 0.16);
.umodal-box {
width: 90%;
height: 240rpx;
position: absolute;
background: #fff;
border-radius: 12rpx;
top: 600rpx;
left: 5%;
.umodal-content {
width: 100%;
height: 140rpx;
font-size: 14px;
color: #606266;
line-height: 140rpx;
padding-left: 12px;
}
.umodal-line1{
width: 100%;
height: 1px;
background: #eaebec;
}
.umodal-line2{
width: 1px;
height: 100%;
background: #eaebec;
}
.umodal-btnbox {
display: flex;
width: 100%;
height: 100rpx;
justify-content: center;
.umodal-btn {
width: 50%;
height: 100%;
line-height: 90rpx;
text-align: center;
font-size: 16px;
color: rgb(41, 121, 255);
box-sizing: border-box;
}
}
}
}
</style> </style>
Loading…
Cancel
Save