修改职业危害
This commit is contained in:
parent
b380d3b267
commit
60d2e16900
@ -66,7 +66,7 @@
|
|||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item required class="custom-form-item" label="职业危害名称" prop="DetailPost"
|
<u-form-item required class="custom-form-item" label="职业危害名称" prop="DetailPost"
|
||||||
:borderBottom="false"
|
:borderBottom="false"
|
||||||
@click="handleQuerySelect({ formIndex: 'Nav_Identifyings', isMultiple: true})">
|
@click="handleQuerySelect({ formIndex: 'Nav_Identifyings', isMultiple: true, dataIndex: index})">
|
||||||
<view slot="right" class="custom-form-item-right">
|
<view slot="right" class="custom-form-item-right">
|
||||||
<view class="multi">
|
<view class="multi">
|
||||||
<u--text v-for="(i, k) in item.Nav_Identifyings" :key="k" class="item"
|
<u--text v-for="(i, k) in item.Nav_Identifyings" :key="k" class="item"
|
||||||
@ -142,9 +142,6 @@
|
|||||||
listPropUpload: ['TASK_ID'],
|
listPropUpload: ['TASK_ID'],
|
||||||
listPropValUpload: [],
|
listPropValUpload: [],
|
||||||
model: {
|
model: {
|
||||||
Nav_LiableUser: {
|
|
||||||
NAME: "",
|
|
||||||
},
|
|
||||||
Nav_Detail: [],
|
Nav_Detail: [],
|
||||||
Nav_Areas: [],
|
Nav_Areas: [],
|
||||||
Nav_Files: [],
|
Nav_Files: [],
|
||||||
@ -159,6 +156,7 @@
|
|||||||
lists: [],
|
lists: [],
|
||||||
formIndex: undefined,
|
formIndex: undefined,
|
||||||
isMultiple: false,
|
isMultiple: false,
|
||||||
|
dataIndex:undefined,
|
||||||
},
|
},
|
||||||
Lists: [],
|
Lists: [],
|
||||||
currSearchType: "",
|
currSearchType: "",
|
||||||
@ -188,7 +186,6 @@
|
|||||||
} else {
|
} else {
|
||||||
this.isAdd = 1;
|
this.isAdd = 1;
|
||||||
let currUser = uni.getStorageSync('appInfo').User;
|
let currUser = uni.getStorageSync('appInfo').User;
|
||||||
this.model.Nav_LiableUser.NAME = currUser.NAME;
|
|
||||||
this.model.LIABLE_USER_ID = currUser.ID;
|
this.model.LIABLE_USER_ID = currUser.ID;
|
||||||
this.model.ID = guid();
|
this.model.ID = guid();
|
||||||
const json = initFilter(this.ORG_ID, "", "NAME", 1);
|
const json = initFilter(this.ORG_ID, "", "NAME", 1);
|
||||||
@ -269,7 +266,6 @@
|
|||||||
},
|
},
|
||||||
handleChange(title, item) {
|
handleChange(title, item) {
|
||||||
this.currentOperate = item;
|
this.currentOperate = item;
|
||||||
console.log(this.currentOperate)
|
|
||||||
this.currSearchType = title;
|
this.currSearchType = title;
|
||||||
this.showPopup = true;
|
this.showPopup = true;
|
||||||
this.handleSearch('init');
|
this.handleSearch('init');
|
||||||
@ -283,7 +279,7 @@
|
|||||||
extendFilterGroup(json, tempGroup);
|
extendFilterGroup(json, tempGroup);
|
||||||
}
|
}
|
||||||
if (this.currSearchType == "Nav_Area") {
|
if (this.currSearchType == "Nav_Area") {
|
||||||
if (!this.model.Nav_Areas.length > 0) {
|
if (this.model.Nav_Areas.length > 0) {
|
||||||
extendRule(json, 'TASK_ID', 1, this.model.ID);
|
extendRule(json, 'TASK_ID', 1, this.model.ID);
|
||||||
extendInclude(json, 'Nav_Area');
|
extendInclude(json, 'Nav_Area');
|
||||||
getRequest(json, "/HM/HazardTaskArea/Entities").then(res => {
|
getRequest(json, "/HM/HazardTaskArea/Entities").then(res => {
|
||||||
@ -397,6 +393,7 @@
|
|||||||
this.qsCom = {
|
this.qsCom = {
|
||||||
show: true,
|
show: true,
|
||||||
name: opt.NAME,
|
name: opt.NAME,
|
||||||
|
dataIndex:opt.dataIndex,
|
||||||
formIndex: opt.formIndex,
|
formIndex: opt.formIndex,
|
||||||
isMultiple: opt.isMultiple,
|
isMultiple: opt.isMultiple,
|
||||||
lists: column
|
lists: column
|
||||||
@ -423,13 +420,23 @@
|
|||||||
extendGroupRule(tempGroup, 'NAME', 9, value)
|
extendGroupRule(tempGroup, 'NAME', 9, value)
|
||||||
extendFilterGroup(json, tempGroup);
|
extendFilterGroup(json, tempGroup);
|
||||||
}
|
}
|
||||||
let result = []
|
let result = [];
|
||||||
extendRule(json, 'TASK_ID', 1, this.model.ID);
|
var raw = [];
|
||||||
extendInclude(json, 'Nav_Identifying');
|
if (this.model.Nav_Identifyings.length > 0) {
|
||||||
const raw = await getRequest(json, "/HM/HazardTaskIdentifying/Entities").then(res => {
|
extendRule(json, 'TASK_ID', 1, this.model.ID);
|
||||||
this.curTotal = res.TotalCount
|
extendInclude(json, 'Nav_Identifying');
|
||||||
return res
|
raw = await getRequest(json, "/HM/HazardTaskIdentifying/Entities").then(res => {
|
||||||
})
|
this.curTotal = res.TotalCount
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
extendRule(json, 'RISK_TYPE', 1, 2);
|
||||||
|
raw = await getIdentifying(json).then(res => {
|
||||||
|
this.curTotal = res.TotalCount
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
result = raw.map(item => {
|
result = raw.map(item => {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
@ -437,26 +444,23 @@
|
|||||||
IDENTIFYING_ID: item?.Nav_Identifying.ID
|
IDENTIFYING_ID: item?.Nav_Identifying.ID
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(result)
|
|
||||||
return result
|
return result
|
||||||
},
|
},
|
||||||
onSelectedQS(val) {
|
onSelectedQS(val) {
|
||||||
console.log(val)
|
const { formIndex, dataIndex } = this.qsCom
|
||||||
const {
|
var detailId=this.model.Nav_Detail[dataIndex].ID;
|
||||||
formIndex,
|
this.model.Nav_Detail[dataIndex].Nav_Identifyings = [];
|
||||||
} = this.qsCom
|
|
||||||
this.model.Nav_Detail.Nav_Identifyings = [];
|
|
||||||
val.forEach(item => {
|
val.forEach(item => {
|
||||||
let obj = {
|
let obj = {
|
||||||
IDENTIFYING_ID: item.ID,
|
IDENTIFYING_ID: item.IDENTIFYING_ID,
|
||||||
Nav_Identifying: {
|
Nav_Identifying: {
|
||||||
NAME: item.NAME
|
NAME: item.NAME
|
||||||
},
|
},
|
||||||
ID: guid(),
|
ID: guid(),
|
||||||
TASK_ID: this.model.ID,
|
TASK_DETAIL_ID: detailId,
|
||||||
ORG_ID: this.ORG_ID,
|
ORG_ID: this.ORG_ID,
|
||||||
}
|
}
|
||||||
this.model.Nav_Detail.Nav_Identifyings.push(obj);
|
this.model.Nav_Detail[dataIndex].Nav_Identifyings.push(obj);
|
||||||
})
|
})
|
||||||
this.qsCom.show = false
|
this.qsCom.show = false
|
||||||
},
|
},
|
||||||
@ -477,29 +481,15 @@
|
|||||||
if (this.model.NOTE_AKER_ID == "") {
|
if (this.model.NOTE_AKER_ID == "") {
|
||||||
this.model.NOTE_AKER_ID = uni.getStorageSync('appInfo').User.ID;
|
this.model.NOTE_AKER_ID = uni.getStorageSync('appInfo').User.ID;
|
||||||
}
|
}
|
||||||
this.model.Nav_Areas.forEach(item => {
|
|
||||||
item.IS_DELETED = true;
|
|
||||||
});
|
|
||||||
var uniqueAreas = new Set();
|
|
||||||
this.model.Nav_Detail.filter(t => t.IS_DELETED == false).forEach(function(obj) {
|
|
||||||
uniqueAreas.add(obj.AREA_ID);
|
|
||||||
});
|
|
||||||
let uniqueAreasArray = Array.from(uniqueAreas);
|
|
||||||
uniqueAreasArray.forEach(item => {
|
|
||||||
let obj = {
|
|
||||||
AREA_ID: item,
|
|
||||||
TASK_ID: this.model.ID,
|
|
||||||
ORG_ID: this.ORG_ID,
|
|
||||||
}
|
|
||||||
this.model.Nav_Areas.push(obj)
|
|
||||||
})
|
|
||||||
this.model.Nav_LiableUser = null;
|
|
||||||
this.model.Nav_Detail.forEach(item => {
|
this.model.Nav_Detail.forEach(item => {
|
||||||
item.Nav_User = null;
|
item.Nav_User = null;
|
||||||
item.Nav_Area = null;
|
item.Nav_Area = null;
|
||||||
item.Nav_Users.forEach(item2 => {
|
item.Nav_Users.forEach(item2 => {
|
||||||
item2.Nav_User = null;
|
item2.Nav_User = null;
|
||||||
});
|
});
|
||||||
|
item.Nav_Identifyings.forEach(item2 => {
|
||||||
|
item2.Nav_Identifying = null;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
this.model.Nav_Files.forEach(item => {
|
this.model.Nav_Files.forEach(item => {
|
||||||
if (item.TASK_ID == undefined) {
|
if (item.TASK_ID == undefined) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user