排查详情表单禁用处理

main
limingtao 11 months ago
parent a9feca0131
commit 7ec85a3de7
  1. 222
      pages/investigation/task.vue

@ -37,7 +37,7 @@
<view class="Height100 Flex Flex_end Flex_C_S-Center" style="line-height: 37px; ">
<input v-if="isEdit" type="text" class="BorderNone Height100 formInput"
v-model="formData.roadType" placeholder="请输入道路类型" />
<view class="Height100" v-else>{{ formData.roadType }}</view>
<view class="Height100" v-else>{{ formData.roadType }}</view>
<view class="Height100"></view>
</view>
</uni-forms-item>
@ -45,7 +45,7 @@
<view class="Height100 Flex Flex_end Flex_C_S-Center" style="line-height: 37px; ">
<input v-if="isEdit" type="number" class="BorderNone Height100 formInput"
v-model="formData.roadWidth" placeholder="请输入道路宽度" />
<view class="Height100" v-else>{{ formData.roadWidth }}</view>
<view class="Height100" v-else>{{ formData.roadWidth }}</view>
<view class="Height100"></view>
</view>
</uni-forms-item>
@ -53,7 +53,7 @@
<view class="Height100 Flex Flex_end Flex_C_S-Center" style="line-height: 37px; ">
<input v-if="isEdit" type="number" class="BorderNone Height100 formInput"
v-model="formData.laneCount" placeholder="请输入车辆数" />
<view class="Height100" v-else>{{ formData.laneCount }}</view>
<view class="Height100" v-else>{{ formData.laneCount }}</view>
<view class="Height100"></view>
</view>
</uni-forms-item>
@ -61,7 +61,7 @@
<view class="Height100 Flex Flex_end Flex_C_S-Center" style="line-height: 37px; ">
<input v-if="isEdit" type="text" class="BorderNone Height100 formInput"
v-model="formData.roadStructure" placeholder="请输入路面结构" />
<view class="Height100" v-else>{{ formData.roadStructure }}</view>
<view class="Height100" v-else>{{ formData.roadStructure }}</view>
<view class="Height100"></view>
</view>
</uni-forms-item>
@ -69,7 +69,7 @@
<view class="Height100 Flex Flex_end Flex_C_S-Center" style="line-height: 37px; ">
<input v-if="isEdit" type="text" class="BorderNone Height100 formInput"
v-model="formData.sideProtec" placeholder="请输入路侧防护" />
<view class="Height100" v-else>{{ formData.sideProtec }}</view>
<view class="Height100" v-else>{{ formData.sideProtec }}</view>
<view class="Height100"></view>
</view>
</uni-forms-item>
@ -77,7 +77,7 @@
<view class="Height100 Flex Flex_end Flex_C_S-Center" style="line-height: 37px; ">
<input v-if="isEdit" type="text" class="BorderNone Height100 formInput"
v-model="formData.centerSeparate" placeholder="请输入中央隔离" />
<view class="Height100" v-else>{{ formData.centerSeparate }}</view>
<view class="Height100" v-else>{{ formData.centerSeparate }}</view>
<view class="Height100"></view>
</view>
</uni-forms-item>
@ -85,7 +85,7 @@
<view class="Height100 Flex Flex_end Flex_C_S-Center" style="line-height: 37px; ">
<input v-if="isEdit" type="number" class="BorderNone Height100 formInput"
v-model="formData.designSpeed" placeholder="请输入设计时速" />
<view class="Height100" v-else>{{ formData.designSpeed }}</view>
<view class="Height100" v-else>{{ formData.designSpeed }}</view>
<view class="Height100">Km/h</view>
</view>
</uni-forms-item>
@ -93,7 +93,7 @@
<view class="Height100 Flex Flex_end Flex_C_S-Center" style="line-height: 37px; ">
<input v-if="isEdit" type="number" class="BorderNone Height100 formInput"
v-model="formData.limitSpeed" placeholder="请输入限速" />
<view class="Height100" v-else>{{ formData.limitSpeed }}</view>
<view class="Height100" v-else>{{ formData.limitSpeed }}</view>
<view class="Height100">Km/h</view>
</view>
</uni-forms-item>
@ -111,7 +111,7 @@
<view class="Height100 Flex Flex_end Flex_C_S-Center" style="line-height: 37px; ">
<input v-if="isEditStep2" type="number" class="BorderNone Height100 formInput"
v-model="formData.maxTraffic" placeholder="请输入最大流量" />
<view class="Height100" v-else>{{ formData.maxTraffic }}</view>
<view class="Height100" v-else>{{ formData.maxTraffic }}</view>
<view class="Height100"></view>
</view>
</uni-forms-item>
@ -119,7 +119,7 @@
<view class="Height100 Flex Flex_end Flex_C_S-Center" style="line-height: 37px; ">
<input v-if="isEditStep2" type="number" class="BorderNone Height100 formInput"
v-model="formData.peakTraffic" placeholder="请输入高峰流量" />
<view class="Height100" v-else>{{ formData.peakTraffic }}</view>
<view class="Height100" v-else>{{ formData.peakTraffic }}</view>
<view class="Height100"></view>
</view>
</uni-forms-item>
@ -127,7 +127,7 @@
<view class="Height100 Flex Flex_end Flex_C_S-Center" style="line-height: 37px; ">
<input v-if="isEditStep2" type="number" class="BorderNone Height100 formInput"
v-model="formData.peakHours" placeholder="请输入高峰时段" />
<view class="Height100" v-else>{{ formData.peakHours }}</view>
<view class="Height100" v-else>{{ formData.peakHours }}</view>
<view class="Height100"></view>
</view>
</uni-forms-item>
@ -135,16 +135,16 @@
<view class="Height100 Flex Flex_end Flex_C_S-Center" style="line-height: 37px; ">
<input v-if="isEditStep2" type="number" class="BorderNone Height100 formInput"
v-model="formData.normalTraffic" placeholder="请输入高峰时段" />
<view class="Height100" v-else>{{ formData.normalTraffic }}</view>
<view class="Height100" v-else>{{ formData.normalTraffic }}</view>
<view class="Height100"></view>
</view>
</uni-forms-item>
<uni-forms-item label="大车占比">
<view class="Height100 Flex Flex_end Flex_C_S-Center" style="line-height: 37px; ">
<input v-if="isEditStep2" type="number" class="BorderNone Height100 formInput"
v-model="formData.largeVehicleRate" placeholder="请输入大车占比" />
<view class="Height100" v-else>{{ formData.largeVehicleRate }}</view>
<view class="Height100" v-else>{{ formData.largeVehicleRate }}</view>
<view class="Height100">%</view>
</view>
</uni-forms-item>
@ -152,7 +152,7 @@
<view class="Height100 Flex Flex_end Flex_C_S-Center" style="line-height: 37px; ">
<input v-if="isEditStep2" type="number" class="BorderNone Height100 formInput"
v-model="formData.nonvehicleTraffic" placeholder="请输入非机动车流量" />
<view class="Height100" v-else>{{ formData.nonvehicleTraffic }}</view>
<view class="Height100" v-else>{{ formData.nonvehicleTraffic }}</view>
<view class="Height100"></view>
</view>
</uni-forms-item>
@ -162,12 +162,11 @@
<view class="point">
<view class="title">重点排查</view>
<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">
<view class="item">{{ item.name }}</view>
</view>
<view style="width: 300rpx;">
<view style="width: 300rpx;" v-show="type!='view'">
<view class="item add" @click="showInvestigation = true">
<uni-icons type="plusempty" size="24" style="margin-right: 10rpx; color: #2663bf" />
新增排查
@ -176,15 +175,16 @@
</view>
</view>
<u-checkbox-group v-model="checked" iconPlacement="right" placement="column">
<u-checkbox v-for="(item,index) in troubleshootingData" :key="index" :label="item.itemname" activeColor="#2663BF"
:name="item.id" @click="showInvestigationTag2(item)" style="padding: 8px 12px;"></u-checkbox>
<u-checkbox v-for="(item,index) in troubleshootingData" :key="index" :label="item.itemname"
activeColor="#2663BF" :name="item.id" @click="showInvestigationTag2(item)"
style="padding: 8px 12px;"></u-checkbox>
</u-checkbox-group>
<u-popup :show="showInvestigation" @close="showInvestigation = false">
<InvestigationItem @select="select2"></InvestigationItem>
</u-popup>
<u-popup :show="showInvestigation2" @close="showInvestigation2 = false">
<InvestigationItem2 :json="showInvestigation2Item" :businessId="this.businessId" @show="showInvestigation2 = false"
@select="select3"></InvestigationItem2>
<InvestigationItem2 :json="showInvestigation2Item" :businessId="this.businessId"
@show="showInvestigation2 = false" @select="select3"></InvestigationItem2>
</u-popup>
<!-- <u-popup :show="showInvestigation" @close="showInvestigation = false">
<view class="custom-pop-head">
@ -244,34 +244,34 @@
<view class="formBox form-step-3" v-if="active === 3">
<view class="point">
<view class="title">存在隐患</view>
<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 class="problem-item">
<view style="display: flex; justify-content: space-between">
<view style="width: 80%;line-height: 30px;">
{{ item.hdTermName }}
</view>
<view>
<view class="check" @click="onHiddenDangerList(item,index)">
<image style="width: 10px; height: 16px"
src="../../static/scimg/right6.png"></image>
<!-- <uni-icons
<view v-for="(item,index) in hiddenDangerList" :key="item" style="width: 100%">
<view class="problem-item">
<view style="display: flex; justify-content: space-between">
<view style="width: 80%;line-height: 30px;">
{{ item.hdTermName }}
</view>
<view>
<view class="check" @click="onHiddenDangerList(item,index)">
<image style="width: 10px; height: 16px"
src="../../static/scimg/right6.png"></image>
<!-- <uni-icons
type="right"
size="24"
style="color: #2663bf"
/> -->
</view>
</view>
</view>
<!-- <view class="text">{{ item.hdTerm }}</view> -->
<!-- <view class="text">{{ item.hdDesc }}</view> -->
</view>
<!-- <view class="text">{{ item.hdTerm }}</view> -->
<!-- <view class="text">{{ item.hdDesc }}</view> -->
</view>
</view>
</scroll-view>
<u-col :span="12">
<u-col :span="12" v-show="type!='view'">
<view class="problem-item add" @click="add">
<uni-icons type="plusempty" size="24" style="margin-right: 10rpx; color: #2663bf" />
新增隐患
@ -342,25 +342,18 @@
</view>
<view class="blank" />
</view>
<bottom-button-two :type="type" v-if="active === 1" @cancel="isEdit = !isEdit" :cancelText="isEdit?'取消':'更改'" @confirm="
<bottom-button-two :type="type" v-if="active === 1" @cancel="isEdit = !isEdit" :cancelText="isEdit?'取消':'更改'"
@confirm="
isEdit = false;
active = 2;
" />
<bottom-button :type="type" v-else-if="active === 2" :secondText="isEditStep2?'取消':'更改'" @second="isEditStep2 = !isEditStep2"
@first="active = 1" @last="active = 3" />
<bottom-button isSubmit :type="type" v-else-if="active === 3" :secondText="'暂存'" @first="active = 2" @second="submit(false)"
@last="submit(true)" />
<u-modal
:show="modalShow"
content="您未录入任何隐患问题,该点段将以“无隐患”结论提交结果,请确认是否提交?"
confirm-text="确定"
cancel-text="取消"
:showConfirmButton="true"
:showCancelButton="true"
@confirm="postSaveManualInvestigation"
@cancel="modalShow = false"
:closeOnClickOverlay="false"
></u-modal>
<bottom-button :type="type" v-else-if="active === 2" :secondText="isEditStep2?'取消':'更改'"
@second="isEditStep2 = !isEditStep2" @first="active = 1" @last="active = 3" />
<bottom-button isSubmit :type="type" v-else-if="active === 3" :secondText="'暂存'" @first="active = 2"
@second="submit(false)" @last="submit(true)" />
<u-modal :show="modalShow" content="您未录入任何隐患问题,该点段将以“无隐患”结论提交结果,请确认是否提交?" confirm-text="确定" cancel-text="取消"
:showConfirmButton="true" :showCancelButton="true" @confirm="postSaveManualInvestigation"
@cancel="modalShow = false" :closeOnClickOverlay="false"></u-modal>
</view>
</template>
@ -393,7 +386,7 @@
onLoad(e) {
if (e.id) {
this.businessId = e.id;
this.type = e.type;
this.getBaseData(e.id);
}
@ -568,7 +561,7 @@
extraConfigs: [],
describeArr: [],
temporary: '',
type:''
type: ''
};
},
methods: {
@ -577,14 +570,14 @@
this.showInvestigation2 = true;
this.showInvestigation2Item = v;
},
showInvestigationTag2(v){
showInvestigationTag2(v) {
console.log(v, this.investigationSelectList)
if(this.checked.includes(v.id)){
if (this.checked.includes(v.id)) {
this.showInvestigation2 = true;
this.showInvestigation2Item = v
}
},
select2(v, list, list2) {
list.dangerItems.forEach(item => {
@ -651,7 +644,7 @@
// } else {
// this.$.toast("");
// }
},
select3(v) {
// this.investigationSelectList.map((r) => {
@ -663,7 +656,7 @@
this.showInvestigation2Item = {};
this.showInvestigation2 = false;
this.troubleshootingData.map(r => {
if(r.id == v.id){
if (r.id == v.id) {
r.checkedSelect = v.checkedSelect
r.extraConfigs = v.extraConfigs
}
@ -755,8 +748,8 @@
)
.then((res) => {
if (res.code === 200) {
for(let k in res.result){
if(res.result[k] == 0) {
for (let k in res.result) {
if (res.result[k] == 0) {
res.result[k] = ""
}
}
@ -796,11 +789,11 @@
// todo
this.investigationSelectList = res.result;
this.investigationSelectList.map((r) => {
this.troubleshootingData = [...this.troubleshootingData,...r.dangerItems]
this.troubleshootingData = [...this.troubleshootingData, ...r.dangerItems]
});
this.checked = this.troubleshootingData.map(r => {
if(r.checked == 1){
if (r.checked == 1) {
return r.id
}
})
@ -1040,13 +1033,16 @@
}
},
submit(temporary) {
//
if (this.type == 'view') {
return uni.navigateBack();
}
let checkedArr = this.troubleshootingData.filter(r => this.checked.includes(r.id))
console.log(checkedArr)
let extraConfigs = [];
checkedArr.map((r) => {
if(!r.extraConfigs) return
if (!r.extraConfigs) return
r.extraConfigs.map((s) => {
s.scenesId = r.nid;
s.dangerId = r.id;
@ -1079,38 +1075,38 @@
} catch (e) {
//TODO handle the exception
}
checkedArr.map(r =>{
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
pcType: 1
})
})
console.log(this.investigationSelectList);
console.log(this.troubleshootingData);
console.log({
...this.formData,
businessId: this.businessId,
extraConfigs: extraConfigs,
describe: describe,
businessId: this.businessId,
extraConfigs: extraConfigs,
describe: describe,
});
this.extraConfigs = extraConfigs
this.describeArr = describe
this.temporary = temporary
console.log(this.extraConfigs,this.describeArr)
if(!temporary) {
console.log(this.extraConfigs, this.describeArr)
if (!temporary) {
this.postSaveManualInvestigation()
return
}
if(this.extraConfigs.length <= 0 || this.describeArr.length <= 0) {
if (this.extraConfigs.length <= 0 || this.describeArr.length <= 0) {
this.modalShow = true
} else {
this.postSaveManualInvestigation()
}
},
postSaveManualInvestigation() {
this.$request
@ -1138,7 +1134,7 @@
.then((res) => {
console.log(res);
if (res.code === 200) {
if(this.temporary) {
if (this.temporary) {
this.$.toast("保存成功");
} else {
this.$.toast("暂存成功");
@ -1452,6 +1448,7 @@
padding: 0 20rpx;
overflow-x: auto;
}
.u-checkbox-group--row {
flex-direction: column;
padding: 0 20rpx;
@ -1460,33 +1457,34 @@
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;
}
.formInput {
width: 90%;
margin-right: 4px;
font-size: 14px;
}
::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;
}
.formInput {
width: 90%;
margin-right: 4px;
font-size: 14px;
}
</style>
Loading…
Cancel
Save