隐患排查处理

main
limingtao 11 months ago
parent 70791d044e
commit fb0e72fea2
  1. 3
      App.vue
  2. 46
      manifest.json
  3. 1
      pages/investigation/components/investigation-item.vue
  4. 190
      pages/investigation/task.vue
  5. 4
      pages/mine/index.vue

@ -40,4 +40,7 @@ uni-toast{
background: linear-gradient( 135deg, #5282CC 0%, #1246B3 100%);
color: #ffffff;
}
.uni-system-preview-image{
z-index: 1000000!important;
}
</style>

@ -1,6 +1,6 @@
{
"name" : "隐患排查",
"appid" : "__UNI__CAFA804",
"appid" : "__UNI__68B38F3",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
@ -65,33 +65,33 @@
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
"hdpi" : "",
"xhdpi" : "",
"xxhdpi" : "",
"xxxhdpi" : ""
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"appstore" : "",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
"app" : "",
"app@2x" : "",
"notification" : "",
"notification@2x" : "",
"proapp@2x" : "",
"settings" : "",
"settings@2x" : "",
"spotlight" : "",
"spotlight@2x" : ""
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
"app@2x" : "",
"app@3x" : "",
"notification@2x" : "",
"notification@3x" : "",
"settings@2x" : "",
"settings@3x" : "",
"spotlight@2x" : "",
"spotlight@3x" : ""
}
}
}

@ -167,6 +167,7 @@
sid
}, 'GET').then(res => {
if (res.code == 200) {
console.log(res.result)
this.investigationDetailList = res.result.map(item => {
switch (item.type) {

@ -247,7 +247,8 @@
<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" v-show="item.pcType!=1"
style="width: 100%">
<view class="problem-item">
<view style="display: flex; justify-content: space-between">
<view style="width: 80%;line-height: 30px;">
@ -579,6 +580,11 @@
if (this.checked.includes(v.id)) {
this.showInvestigation2 = true;
this.showInvestigation2Item = v
for (let item of this.hiddenDangerList) {
if (v.id == item.hdTerm) {
this.$set(this.showInvestigation2Item, 'checkedSelect', item)
}
}
}
},
@ -800,16 +806,32 @@
.then((res) => {
if (res.code === 200) {
// todo
for (let items of res.result) {
for (let item of items.dangerItems) {
item.nid = items.nid
}
}
// console.log(res.result,11111)
this.investigationSelectList = res.result;
this.investigationSelectList.map((r) => {
this.troubleshootingData = [...this.troubleshootingData, ...r.dangerItems]
});
// console.log(this.troubleshootingData, 11111)
this.checked = this.troubleshootingData.map(r => {
if (r.checked == 1) {
return r.id
}
})
this.checked = this.checked.filter(item => item !== undefined);
for (let i in this.troubleshootingData) {
if (this.troubleshootingData[i].checked == 1) {
// alert(111)
this.initTroubleshootingData(this.troubleshootingData[i].id, i)
}
}
// console.log(this.troubleshootingData)
// this.$request
// .globalRequest(
// "/hiddenDanger/highDanger/getImportDangerDisplayDetail", {
@ -857,10 +879,10 @@
)
.then((res) => {
if (res.code === 200) {
console.log(res.result);
this.hiddenDangerList = res.result;
this.hiddenDangerList.push(...res.result)
}
});
this.$request
.globalRequest(
"/hiddenDanger/highDanger/getDangerItems", {
@ -886,9 +908,68 @@
JSON.stringify(this.hiddenDangerList3)
);
}
console.log(this.hiddenDangerList2)
},
initCheckedSelect() {
this.$request
.globalRequest(
"/hiddenDanger/highDanger/getUserHiddenDangerList", {
nuserid: this.$.getData("token"),
pcType: 1,
businessId: this.businessId
},
"GET"
)
.then((res) => {
if (res.code === 200) {
this.hiddenDangerList.push(...res.result)
console.log(this.troubleshootingData, 123)
console.log(res.result, 321)
for (let i in this.troubleshootingData) {
for (let j in res.result) {
if (this.troubleshootingData[i].id == res.result[j].hdTerm) {
this.$set(this.troubleshootingData[i], "checkedSelect", {
hdInfo: res.result[j].hdInfo,
hdPic: res.result[j].hdPic,
hdDesc: res.result[j].hdDesc,
hdTerm: res.result[j].hdTerm,
pcType: 1
})
}
}
}
}
});
},
initTroubleshootingData(id, index) {
this.troubleshootingData[index].extraConfigs = []
this.$request
.globalRequest(
"/hiddenDanger/highDanger/getImportDangerDisplayDetail",
{
dangerId: id,
businessId: this.businessId,
},
"GET"
)
.then((res) => {
if (res.code == 200) {
this.troubleshootingData[index].extraConfigs.push(...res.result)
}
if (this.checked.length - 1 == index) {
// alert(1111)
this.initCheckedSelect(index)
}
});
// this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangers', {}, 'GET').then(res => {
// if (res.code == 200) {
// this.investigationList = res.result
// }
// })
},
select(v) {
this.hiddenDangerList3 = v;
},
@ -1057,7 +1138,7 @@
return uni.navigateBack();
}
let checkedArr = this.troubleshootingData.filter(r => this.checked.includes(r.id))
console.log(checkedArr)
// console.log(11111111, checkedArr)
let extraConfigs = [];
checkedArr.map((r) => {
@ -1074,7 +1155,9 @@
extraConfigs.push(s);
});
});
let describe = JSON.parse(JSON.stringify(this.hiddenDangerList))
console.log(describe)
try {
for (let item of describe) {
if (item.nid) {
@ -1094,7 +1177,16 @@
} catch (e) {
//TODO handle the exception
}
setTimeout(() => {
// let describe = [{ hdTerm: 1 }, { hdTerm: 2 }, { hdTerm: 3 }];
// let checkedArr = [{ id: 1 }, { hdTerm: 5 }, { hdTerm: 3 }];
// checkedArr.iddescribe
let notFoundIncheckedArr = [];
// describecheckedArr
let indexes = [];
if (describe.length <= 0) {
checkedArr.map(r => {
describe.push({
hdTerm: r.id,
@ -1104,14 +1196,75 @@
pcType: 1
})
})
console.log(this.investigationSelectList);
console.log(this.troubleshootingData);
console.log({
...this.formData,
businessId: this.businessId,
extraConfigs: extraConfigs,
describe: describe,
} else {
checkedArr.forEach((item2, index2) => {
let idToFind = item2.id;
let foundIndex = describe.findIndex(item1 => item1.hdTerm === idToFind);
if (foundIndex === -1) {
if (item2.checkedSelect) {
describe.push({ ...item2.checkedSelect, pcType: 1, hdTerm: item2.id, });
}
// describehdTermitem2describe
// console.log(`: ${idToFind} describe`);
} else {
let obj = {
hdTerm: item2.id,
hdDesc: item2.checkedSelect ? item2.checkedSelect.hdDesc : '',
hdPic: item2.checkedSelect ? item2.checkedSelect.hdPic : '',
hdInfo: item2.checkedSelect ? item2.checkedSelect.hdInfo : '',
pcType: 1
}
console.log(obj, 111111)
describe[foundIndex] = obj;
// hdTermdescribe
// describe[foundIndex] = { hdTerm: idToFind };
// console.log(`: describe[${foundIndex}] = ${idToFind}`);
}
// console.log(`describe:`, describe);
});
// describe.forEach((item1, index1) => {
// let found = false;
// checkedArr.forEach((item2, index2) => {
// if (item1.hdTerm === item2.id) {
// found = true;
// let obj = {
// hdTerm: item2.id,
// hdDesc: item2.checkedSelect ? item2.checkedSelect.hdDesc : '',
// hdPic: item2.checkedSelect ? item2.checkedSelect.hdPic : '',
// hdInfo: item2.checkedSelect ? item2.checkedSelect.hdInfo : '',
// pcType: 1
// }
// describe.splice(index1, 1, obj);
// // indexes.push({ describeIndex: index1, checkedArrIndex: index2 });
// }
// if (!found) {
// // pusharr1notFoundIncheckedArr
// describe.push({ ...item2 }); // arr1
// }
// });
// });
}
console.log("Not found in checkedArr:", notFoundIncheckedArr);
console.log("Indexes of matching elements:", indexes);
// arr1
// arr1.push(...notFoundInArr2); //
// console.log(describe)
// return false
// console.log(this.investigationSelectList);
// console.log(this.troubleshootingData);
// console.log({
// ...this.formData,
// businessId: this.businessId,
// extraConfigs: extraConfigs,
// describe: describe,
// });
this.extraConfigs = extraConfigs
this.describeArr = describe
this.temporary = temporary
@ -1125,6 +1278,7 @@
} else {
this.postSaveManualInvestigation()
}
}, 1);
},
postSaveManualInvestigation() {
@ -1158,11 +1312,11 @@
} else {
this.$.toast("暂存成功");
}
// setTimeout(() => {
// uni.navigateBack({
// delta: 2, // 1
// });
// }, 1000);
setTimeout(() => {
uni.navigateBack({
delta: 2, // 1
});
}, 1000);
// this.data = res.result;
// this.rname = this.data[0].name;

@ -264,7 +264,7 @@
.u-cell-group {
margin: 0 32rpx;
padding: 15rpx 20rpx;
background-color: rgba(255, 255, 255, 0.6);
background-color: rgba(255, 255, 255, 0.75);
border-radius: 13rpx;
@ -314,7 +314,7 @@
.logout {
width: 690rpx;
background-color: rgba(255, 255, 255, 0.6);
background-color: rgba(255, 255, 255, 0.75);
text-align: center;
margin-top: 20rpx;
margin-left: 30rpx;

Loading…
Cancel
Save