去除index,采用item
This commit is contained in:
parent
9cbdd7ca30
commit
ef2baad230
@ -59,18 +59,18 @@
|
|||||||
<u-form-item prop="Nav_Contents">
|
<u-form-item prop="Nav_Contents">
|
||||||
|
|
||||||
<view style="display: flex;flex-direction: row;justify-content: space-between;align-items: center;flex: 1;">
|
<view style="display: flex;flex-direction: row;justify-content: space-between;align-items: center;flex: 1;">
|
||||||
<view @click="handleChangeStep(index,'Area')" style="flex: 1;">
|
<view @click="handleChangeStep(item,'Area')" style="flex: 1;">
|
||||||
{{index+1+'.辨识区域:'+item.Nav_Area?item.Nav_Area.NAME:''}}
|
{{index+1+'.辨识区域:'+item.Nav_Area?item.Nav_Area.NAME:''}}
|
||||||
</view>
|
</view>
|
||||||
<view class="action" style="display: flex;flex-direction: row;align-items: center;justify-content: space-around;">
|
<view class="action" style="display: flex;flex-direction: row;align-items: center;justify-content: space-around;">
|
||||||
<u-icon @click="handleDelRowBefore(item)" name="trash" color="#ff4d4f" size="21" style="margin-right: 20px;"></u-icon>
|
<u-icon @click="handleDelRowBefore(item)" name="trash" color="#ff4d4f" size="21" style="margin-right: 20px;"></u-icon>
|
||||||
<u-icon name="arrow-up" size="12" v-if="item.showPack" @click="handlePack(index)"></u-icon>
|
<u-icon name="arrow-up" size="12" v-if="item.showPack" @click="handlePack(item)"></u-icon>
|
||||||
<u-icon name="arrow-down" size="12" v-if="!item.showPack" @click="handlePack(index)"></u-icon>
|
<u-icon name="arrow-down" size="12" v-if="!item.showPack" @click="handlePack(item)"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<view v-if="item.showPack==true">
|
<view v-if="item.showPack==true">
|
||||||
<u-form-item label="生产单元:" @click="handleChangeUnit(index,'MinType')" border-bottom>
|
<u-form-item label="生产单元:" @click="handleChangeUnit(item,'MinType')" border-bottom>
|
||||||
<u--input v-model="(item.Nav_ProductionUnit||{}).NAME" disabled disabledColor="#ffffff" placeholder="请选择生产单元" border="none" inputAlign="right" fontSize="14px">
|
<u--input v-model="(item.Nav_ProductionUnit||{}).NAME" disabled disabledColor="#ffffff" placeholder="请选择生产单元" border="none" inputAlign="right" fontSize="14px">
|
||||||
</u--input>
|
</u--input>
|
||||||
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
|
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
|
||||||
@ -89,7 +89,7 @@
|
|||||||
<u--input v-model="item.RISK_DESCRIPTION" placeholder="请填写风险描述" disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
|
<u--input v-model="item.RISK_DESCRIPTION" placeholder="请填写风险描述" disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
|
||||||
</u--input>
|
</u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="风险类别" prop="HIDDEN_LEVEL" @click="handleChangeStep(index,'Category')" border-bottom>
|
<u-form-item label="风险类别" prop="HIDDEN_LEVEL" @click="handleChangeStep(item,'Category')" border-bottom>
|
||||||
<u--input v-model="(item.Nav_Type||{}).NAME" disabled placeholder="请选择风险类别" suffixIcon="arrow-down" suffixIconStyle="font-size: 12px" disabledColor="#ffffff" inputAlign="right"
|
<u--input v-model="(item.Nav_Type||{}).NAME" disabled placeholder="请选择风险类别" suffixIcon="arrow-down" suffixIconStyle="font-size: 12px" disabledColor="#ffffff" inputAlign="right"
|
||||||
fontSize="14px" border="none">
|
fontSize="14px" border="none">
|
||||||
</u--input>
|
</u--input>
|
||||||
@ -122,7 +122,7 @@
|
|||||||
<u--input v-model="item.MARK_NAME" disabled disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
|
<u--input v-model="item.MARK_NAME" disabled disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
|
||||||
</u--input>
|
</u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="是否有效" prop="HIDDEN_PLACE" @click="handleChangeUnit(index,'SKEnableStatusEnum')">
|
<u-form-item label="是否有效" prop="HIDDEN_PLACE" @click="handleChangeUnit(item,'SKEnableStatusEnum')">
|
||||||
<u--input v-model="item.ENABLE_STATUS_NAME" disabled placeholder="请选择是否有效" disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
|
<u--input v-model="item.ENABLE_STATUS_NAME" disabled placeholder="请选择是否有效" disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
|
||||||
</u--input>
|
</u--input>
|
||||||
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
|
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
|
||||||
@ -346,16 +346,17 @@
|
|||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handlePack(index) {
|
handlePack(item) {
|
||||||
this.dataModel.Nav_Details[index].showPack = this.dataModel.Nav_Details[index].showPack == false ? true : false
|
item.showPack = item.showPack == false ? true : false
|
||||||
this.dataModel.Nav_Details = [...this.dataModel.Nav_Details]
|
this.$forceUpdate()
|
||||||
|
|
||||||
},
|
},
|
||||||
cancelUnit() {
|
cancelUnit() {
|
||||||
this.showPopupUnit = false
|
this.showPopupUnit = false
|
||||||
},
|
},
|
||||||
handleChangeUnit(index, name) {
|
handleChangeUnit(item, name) {
|
||||||
this.nowIndex = [index, name]
|
this.nowItem = item
|
||||||
|
this.nowName = name
|
||||||
if (name == 'MinType') {
|
if (name == 'MinType') {
|
||||||
const json = initFilter(this.ORG_ID)
|
const json = initFilter(this.ORG_ID)
|
||||||
getRequest(json, "/FM/UserProductionUnitSet/OrderPaged").then(res => {
|
getRequest(json, "/FM/UserProductionUnitSet/OrderPaged").then(res => {
|
||||||
@ -368,12 +369,12 @@
|
|||||||
this.showPopupUnit = true
|
this.showPopupUnit = true
|
||||||
},
|
},
|
||||||
confirmUnit(e) {
|
confirmUnit(e) {
|
||||||
if (this.nowIndex[1] == 'MinType') {
|
if (this.nowName == 'MinType') {
|
||||||
this.dataModel.Nav_Details[this.nowIndex[0]].Nav_ProductionUnit = e.value[0]
|
this.nowItem.Nav_ProductionUnit = e.value[0]
|
||||||
this.dataModel.Nav_Details[this.nowIndex[0]].PRODUCTION_UNIT_ID = e.value[0].ID
|
this.nowItem.PRODUCTION_UNIT_ID = e.value[0].ID
|
||||||
} else {
|
} else {
|
||||||
this.dataModel.Nav_Details[this.nowIndex[0]].ENABLE_STATUS = e.value[0].code
|
this.nowItem.ENABLE_STATUS = e.value[0].code
|
||||||
this.dataModel.Nav_Details[this.nowIndex[0]].ENABLE_STATUS_NAME = e.value[0].name
|
this.nowItem.ENABLE_STATUS_NAME = e.value[0].name
|
||||||
}
|
}
|
||||||
this.showPopupUnit = false
|
this.showPopupUnit = false
|
||||||
},
|
},
|
||||||
@ -449,6 +450,7 @@
|
|||||||
},
|
},
|
||||||
// 新增处理企业库选择结果的方法
|
// 新增处理企业库选择结果的方法
|
||||||
handleEnterpriseSelection(selectedItems) {
|
handleEnterpriseSelection(selectedItems) {
|
||||||
|
console.log(selectedItems, '999')
|
||||||
if (!selectedItems || selectedItems.length === 0) return
|
if (!selectedItems || selectedItems.length === 0) return
|
||||||
|
|
||||||
const newDetails = []
|
const newDetails = []
|
||||||
@ -470,6 +472,11 @@
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
const convertedMeasures = (enterpriseItem.Nav_Details || [])
|
||||||
|
.map((item, index) => ({
|
||||||
|
...item,
|
||||||
|
MEASURE: item.MEASURES_NAME, // 措施名称
|
||||||
|
}))
|
||||||
|
|
||||||
const convertedItem = {
|
const convertedItem = {
|
||||||
showPack: false,
|
showPack: false,
|
||||||
@ -486,12 +493,14 @@
|
|||||||
Nav_RiskName: enterpriseItem.Nav_RiskName || {
|
Nav_RiskName: enterpriseItem.Nav_RiskName || {
|
||||||
NAME: ''
|
NAME: ''
|
||||||
},
|
},
|
||||||
|
Nav_DetailMeasures: convertedMeasures,
|
||||||
RISK_DESCRIPTION: enterpriseItem.RISK_DESCRIPTION || '',
|
RISK_DESCRIPTION: enterpriseItem.RISK_DESCRIPTION || '',
|
||||||
TYPE_ID: enterpriseItem.TYPE_ID || '',
|
TYPE_ID: enterpriseItem.TYPE_ID || '',
|
||||||
Nav_Type: enterpriseItem.Nav_Type || {
|
Nav_Type: enterpriseItem.Nav_Type || {
|
||||||
NAME: ''
|
NAME: ''
|
||||||
},
|
},
|
||||||
MEASURE: enterpriseItem.MEASURE || '',
|
MEASURE: enterpriseItem.MEASURE || '',
|
||||||
|
|
||||||
EMERGENCY: enterpriseItem.EMERGENCY || '',
|
EMERGENCY: enterpriseItem.EMERGENCY || '',
|
||||||
ENABLE_STATUS: this.enumsData['SKEnableStatusEnum'][0].code,
|
ENABLE_STATUS: this.enumsData['SKEnableStatusEnum'][0].code,
|
||||||
ENABLE_STATUS_NAME: this.enumsData['SKEnableStatusEnum'][0].name,
|
ENABLE_STATUS_NAME: this.enumsData['SKEnableStatusEnum'][0].name,
|
||||||
@ -589,10 +598,11 @@
|
|||||||
|
|
||||||
this.showPopupRecitifyDate = false
|
this.showPopupRecitifyDate = false
|
||||||
},
|
},
|
||||||
handleChangeStep(index, name) {
|
handleChangeStep(item, name) {
|
||||||
this.currentOperateStep = {}
|
this.currentOperateStep = {}
|
||||||
this.showPopupStep = true
|
this.showPopupStep = true
|
||||||
this.nowIndex = [index, name]
|
this.nowItem = item
|
||||||
|
this.nowName = name
|
||||||
this.handleSearchStep('init')
|
this.handleSearchStep('init')
|
||||||
},
|
},
|
||||||
handleClosePopupStep() {
|
handleClosePopupStep() {
|
||||||
@ -600,7 +610,7 @@
|
|||||||
// this.showPopupCertificate = false
|
// this.showPopupCertificate = false
|
||||||
},
|
},
|
||||||
handleSearchStep(val, pageIndex) {
|
handleSearchStep(val, pageIndex) {
|
||||||
let requestInfo = this.nowIndex[1] == 'demand' ? GetSKRequestInfo : this.nowIndex[1] == 'Area' ? GetNewRiskAreaInfo : this.nowIndex[1] == 'RiskName' ? GetRiskNameInfo : GetRiskTypeInfo
|
let requestInfo = this.nowName == 'demand' ? GetSKRequestInfo : this.nowName == 'Area' ? GetRiskAreaInfo : this.nowName == 'RiskName' ? GetRiskNameInfo : GetRiskTypeInfo
|
||||||
const orgId = uni.getStorageSync('orgId')
|
const orgId = uni.getStorageSync('orgId')
|
||||||
const json = initFilter(orgId, "", "", 0, pageIndex ?? 1)
|
const json = initFilter(orgId, "", "", 0, pageIndex ?? 1)
|
||||||
|
|
||||||
@ -629,19 +639,19 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
handleSelectedStep(val) {
|
handleSelectedStep(val) {
|
||||||
if (this.nowIndex[1] == 'demand') {
|
if (this.nowName == 'demand') {
|
||||||
this.dataModel.Nav_Require.NAME = val.NAME
|
this.dataModel.Nav_Require.NAME = val.NAME
|
||||||
this.dataModel.REQUIRE_ID = val.ID
|
this.dataModel.REQUIRE_ID = val.ID
|
||||||
this.dataModel.RequireName = val.NAME
|
this.dataModel.RequireName = val.NAME
|
||||||
} else if (this.nowIndex[1] == 'Area') {
|
} else if (this.nowName == 'Area') {
|
||||||
this.dataModel.Nav_Details[this.nowIndex[0]].Nav_Area.NAME = val.NAME
|
this.nowItem.Nav_Area.NAME = val.NAME
|
||||||
this.dataModel.Nav_Details[this.nowIndex[0]].AREA_ID = val.ID
|
this.nowItem.AREA_ID = val.ID
|
||||||
} else if (this.nowIndex[1] == 'RiskName') {
|
} else if (this.nowName == 'RiskName') {
|
||||||
this.dataModel.Nav_Details[this.nowIndex[0]].Nav_RiskName.NAME = val.NAME
|
this.nowItem.Nav_RiskName.NAME = val.NAME
|
||||||
this.dataModel.Nav_Details[this.nowIndex[0]].RISK_NAME_ID = val.ID
|
this.nowItem.RISK_NAME_ID = val.ID
|
||||||
} else {
|
} else {
|
||||||
this.dataModel.Nav_Details[this.nowIndex[0]].Nav_Type.NAME = val.NAME
|
this.nowItem.Nav_Type.NAME = val.NAME
|
||||||
this.dataModel.Nav_Details[this.nowIndex[0]].TYPE_ID = val.ID
|
this.nowItem.TYPE_ID = val.ID
|
||||||
}
|
}
|
||||||
this.showPopupStep = false
|
this.showPopupStep = false
|
||||||
|
|
||||||
@ -657,7 +667,7 @@
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!item.Nav_Area ||!item.Nav_Area.NAME) {
|
if (!item.Nav_Area || !item.Nav_Area.NAME) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '顺序' + i + '辨识区域不能为空',
|
title: '顺序' + i + '辨识区域不能为空',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@ -685,7 +695,7 @@
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!item.Nav_Type ||!item.Nav_Type.NAME) {
|
if (!item.Nav_Type || !item.Nav_Type.NAME) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '顺序' + i + '风险类别不能为空',
|
title: '顺序' + i + '风险类别不能为空',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@ -704,7 +714,7 @@
|
|||||||
this.model.PUBLISH = "SaveAndNotify";
|
this.model.PUBLISH = "SaveAndNotify";
|
||||||
delete this.model.Nav_ApplyDepartment
|
delete this.model.Nav_ApplyDepartment
|
||||||
delete this.model.Nav_ApplyUser
|
delete this.model.Nav_ApplyUser
|
||||||
this.model.Nav_Details.map(item=>{
|
this.model.Nav_Details.map(item => {
|
||||||
delete item.Nav_ProductionUnit
|
delete item.Nav_ProductionUnit
|
||||||
delete item.Nav_Type
|
delete item.Nav_Type
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user