排查详情表单禁用处理

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

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