重点排查附件处理

main
limingtao 11 months ago
parent 94aabf89f4
commit d3ea1684ab
  1. 95
      pages/investigation/components/investigation-item.vue
  2. 76
      pages/investigation/components/investigation-item2.vue
  3. 11
      pages/investigation/task.vue

@ -1,13 +1,10 @@
<template> <template>
<view> <view>
<view class="investigation-item" <view class="investigation-item" :class="investigationSelect === index ? 'active' : ''"
:class="investigationSelect === index ? 'active' : ''" v-for="(item, index) in investigationList" :key="item.name" @click="handleSelect(item, index)">
v-for="(item, index) in investigationList"
:key="item.name"
@click="handleSelect(item, index)"
>
<text>{{ item.name }}</text> <text>{{ item.name }}</text>
<uni-icons type="checkmarkempty" size="24" :style="{color: '#2663BF', visibility: investigationSelect === index ? 'visible' : 'hidden'}"/> <uni-icons type="checkmarkempty" size="24"
:style="{color: '#2663BF', visibility: investigationSelect === index ? 'visible' : 'hidden'}" />
</view> </view>
<u-popup :show="showInvestigationDetail" @close="showInvestigationDetail = false"> <u-popup :show="showInvestigationDetail" @close="showInvestigationDetail = false">
<view class="custom-pop-head"> <view class="custom-pop-head">
@ -16,57 +13,35 @@
<view class="right" @click="investigationDetailHandle">确认</view> <view class="right" @click="investigationDetailHandle">确认</view>
</view> </view>
<view class="box" style="max-height: 800rpx;overflow-y: auto"> <view class="box" style="max-height: 800rpx;overflow-y: auto">
<view class="investigation-item" <view class="investigation-item" v-for="(item, index) in investigationDetailList" :key="index"
v-for="(item, index) in investigationDetailList" style="width: 96%; padding: 0">
:key="index"
style="width: 96%; padding: 0"
>
<view class="detail-item" v-if="item.type === 'number' || item.type === '1'"> <view class="detail-item" v-if="item.type === 'number' || item.type === '1'">
<uni-forms-item :label="item.name" label-width="300px" style="display: flex;align-items: center"> <uni-forms-item :label="item.name" label-width="300px"
<u-input style="display: flex;align-items: center">
placeholder="请输入" <u-input placeholder="请输入" border="none" v-model="item.standar" inputAlign="right"
border="none" type="number">
v-model="item.standar" <u-text :text="item.unit" slot="suffix" margin="0 3px 0 0" type="tips"></u-text>
inputAlign="right"
type="number"
>
<u-text
:text="item.unit"
slot="suffix"
margin="0 3px 0 0"
type="tips"
></u-text>
</u-input> </u-input>
</uni-forms-item> </uni-forms-item>
</view> </view>
<view class="detail-item" v-else-if="item.type === 'text' || item.type === '2'"> <view class="detail-item" v-else-if="item.type === 'text' || item.type === '2'">
<uni-forms-item :label="item.name" label-width="300px" style="display: flex;align-items: center"> <uni-forms-item :label="item.name" label-width="300px"
<u-input style="display: flex;align-items: center">
placeholder="请输入" <u-input placeholder="请输入" border="none" v-model="item.standar" inputAlign="right" />
border="none"
v-model="item.standar"
inputAlign="right"
/>
</uni-forms-item> </uni-forms-item>
</view> </view>
<view class="detail-item" v-else-if="item.type === 'check' || item.type === '3'"> <view class="detail-item" v-else-if="item.type === 'check' || item.type === '3'">
<uni-forms-item :label="item.name" label-width="300px" style="display: flex;align-items: center"> <uni-forms-item :label="item.name" label-width="300px"
<u-checkbox style="display: flex;align-items: center">
v-model="item.standar" <u-checkbox v-model="item.standar" :customStyle="{justifyContent: 'space-between'}"
:customStyle="{justifyContent: 'space-between'}" :name="'sdfs'" />
:name="'sdfs'"
/>
</uni-forms-item> </uni-forms-item>
</view> </view>
<view class="detail-item" v-else-if="item.type === 'upload' || item.type === '4'"> <view class="detail-item" v-else-if="item.type === 'upload' || item.type === '4'">
<uni-forms-item :label="item.name" label-position="top" label-width="300px" style="display: flex;align-items: center" /> <uni-forms-item :label="item.name" label-position="top" label-width="300px"
<u-upload style="display: flex;align-items: center" />
:fileList="item.fileList" <u-upload :fileList="item.fileList" @afterRead="(e) => afterRead(e, item)"
@afterRead="(e) => afterRead(e, item)" @delete="(e) => deletePic(e, item)" name="1" :maxCount="1"></u-upload>
@delete="(e) => deletePic(e, item)"
name="1"
:maxCount="1"
></u-upload>
</view> </view>
</view> </view>
</view> </view>
@ -107,8 +82,7 @@ export default {
} }
}, },
// //
onShow() { onShow() {},
},
// //
computed: {}, computed: {},
// //
@ -131,6 +105,10 @@ export default {
async afterRead(event, item) { async afterRead(event, item) {
// multiple true , file // multiple true , file
const id = this.uuid() const id = this.uuid()
if (!item.fileList) {
item.fileList = []
}
this.$forceUpdate()
item.fileList.push({ item.fileList.push({
id, id,
...event.file, ...event.file,
@ -175,7 +153,9 @@ export default {
}) })
}, },
getData2(sid) { getData2(sid) {
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangerInfo', {sid}, 'GET').then(res => { this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangerInfo', {
sid
}, 'GET').then(res => {
if (res.code == 200) { if (res.code == 200) {
console.log(res.result) console.log(res.result)
this.investigationDetailList = res.result.map(item => { this.investigationDetailList = res.result.map(item => {
@ -214,8 +194,7 @@ export default {
this.$emit('select', this.investigationList[this.investigationSelect], this.investigationDetailList) this.$emit('select', this.investigationList[this.investigationSelect], this.investigationDetailList)
} }
}, },
onReady() { onReady() {},
},
// //
onUnload() { onUnload() {
@ -228,8 +207,7 @@ export default {
}, 1500); }, 1500);
}, },
// //
onReachBottom() { onReachBottom() {},
},
} }
</script> </script>
@ -249,28 +227,34 @@ page {
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
overflow: hidden; overflow: hidden;
&.active { &.active {
background: #DFEBF8; background: #DFEBF8;
} }
} }
.detail-item { .detail-item {
width: 100%; width: 100%;
background: #F0F3F7; background: #F0F3F7;
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
border-radius: 8rpx; border-radius: 8rpx;
box-sizing: border-box; box-sizing: border-box;
/deep/ .uni-forms-item__content { /deep/ .uni-forms-item__content {
justify-content: flex-end; justify-content: flex-end;
text-align: right; text-align: right;
display: flex; display: flex;
} }
/deep/ .uni-forms-item { /deep/ .uni-forms-item {
margin-bottom: 0; margin-bottom: 0;
} }
/deep/ .uni-forms-item__label { /deep/ .uni-forms-item__label {
font-size: 16px; font-size: 16px;
} }
} }
.custom-pop-head { .custom-pop-head {
width: 100%; width: 100%;
padding: 20rpx; padding: 20rpx;
@ -280,12 +264,15 @@ page {
justify-content: space-between; justify-content: space-between;
border-bottom: 1px solid #E6E6E6; border-bottom: 1px solid #E6E6E6;
margin-bottom: 20rpx; margin-bottom: 20rpx;
.left { .left {
color: #666666; color: #666666;
} }
.title { .title {
font-size: 16px; font-size: 16px;
} }
.right { .right {
color: #2663BF; color: #2663BF;
} }

@ -7,57 +7,32 @@
<view class="right" @click="investigationDetailHandle">确认</view> <view class="right" @click="investigationDetailHandle">确认</view>
</view> </view>
<view class="box" style="max-height: 800rpx;overflow-y: auto"> <view class="box" style="max-height: 800rpx;overflow-y: auto">
<view class="investigation-item" <view class="investigation-item" v-for="(item, index) in investigationDetailList" :key="index"
v-for="(item, index) in investigationDetailList" style="width: 96%; padding: 0">
:key="index"
style="width: 96%; padding: 0"
>
<view class="detail-item" v-if="item.type === 'number' || item.type === '1'"> <view class="detail-item" v-if="item.type === 'number' || item.type === '1'">
<uni-forms-item :label="item.name" label-width="500rpx" style="display: flex;align-items: center"> <uni-forms-item :label="item.name" label-width="500rpx" style="display: flex;align-items: center">
<u-input <u-input placeholder="请输入" border="none" v-model="item.standar" inputAlign="right"
placeholder="请输入" type="number">
border="none" <u-text :text="item.unit" slot="suffix" margin="0 3px 0 0" type="tips"></u-text>
v-model="item.standar"
inputAlign="right"
type="number"
>
<u-text
:text="item.unit"
slot="suffix"
margin="0 3px 0 0"
type="tips"
></u-text>
</u-input> </u-input>
</uni-forms-item> </uni-forms-item>
</view> </view>
<view class="detail-item" v-else-if="item.type === 'text' || item.type === '2'"> <view class="detail-item" v-else-if="item.type === 'text' || item.type === '2'">
<uni-forms-item :label="item.name" label-width="500rpx" style="display: flex;align-items: center"> <uni-forms-item :label="item.name" label-width="500rpx" style="display: flex;align-items: center">
<u-input <u-input placeholder="请输入" border="none" v-model="item.standar" inputAlign="right" />
placeholder="请输入"
border="none"
v-model="item.standar"
inputAlign="right"
/>
</uni-forms-item> </uni-forms-item>
</view> </view>
<view class="detail-item" v-else-if="item.type === 'check' || item.type === '3'"> <view class="detail-item" v-else-if="item.type === 'check' || item.type === '3'">
<uni-forms-item :label="item.name" label-width="500rpx" style="display: flex;align-items: center"> <uni-forms-item :label="item.name" label-width="500rpx" style="display: flex;align-items: center">
<u-checkbox <u-checkbox v-model="item.standar" :customStyle="{justifyContent: 'space-between'}"
v-model="item.standar" :name="'sdfs'" />
:customStyle="{justifyContent: 'space-between'}"
:name="'sdfs'"
/>
</uni-forms-item> </uni-forms-item>
</view> </view>
<view class="detail-item" v-else-if="item.type === 'upload' || item.type === '4'"> <view class="detail-item" v-else-if="item.type === 'upload' || item.type === '4'">
<uni-forms-item :label="item.name" label-position="top" label-width="300px" style="display: flex;align-items: center" /> <uni-forms-item :label="item.name" label-position="top" label-width="300px"
<u-upload style="display: flex;align-items: center" />
:fileList="item.fileList" <u-upload :fileList="item.fileList" @afterRead="(e) => afterRead(e, item)"
@afterRead="(e) => afterRead(e, item)" @delete="(e) => deletePic(e, item)" name="1" :maxCount="1"></u-upload>
@delete="(e) => deletePic(e, item)"
name="1"
:maxCount="1"
></u-upload>
</view> </view>
</view> </view>
</view> </view>
@ -97,6 +72,9 @@
mounted() { mounted() {
if (this.json.name) { if (this.json.name) {
this.investigationDetailList = this.json.extraConfigs.map(item => { this.investigationDetailList = this.json.extraConfigs.map(item => {
if (!item.fileList) {
item.fileList = []
}
switch (item.type) { switch (item.type) {
// case "1": // case "1":
// item.standar = 0 // item.standar = 0
@ -132,8 +110,7 @@
} }
}, },
// //
onShow() { onShow() {},
},
// //
computed: {}, computed: {},
// //
@ -154,6 +131,7 @@
}, },
// //
async afterRead(event, item) { async afterRead(event, item) {
// multiple true , file // multiple true , file
const id = this.uuid() const id = this.uuid()
item.fileList.push({ item.fileList.push({
@ -193,7 +171,9 @@
}) })
}, },
getData() { getData() {
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangerInfo', {sid: this.$props.sid}, 'GET').then(res => { this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangerInfo', {
sid: this.$props.sid
}, 'GET').then(res => {
if (res.code == 200) { if (res.code == 200) {
this.investigationDetailList = res.result.map(item => { this.investigationDetailList = res.result.map(item => {
switch (item.type) { switch (item.type) {
@ -234,8 +214,7 @@
this.$emit('select', this.json) this.$emit('select', this.json)
} }
}, },
onReady() { onReady() {},
},
// //
onUnload() { onUnload() {
@ -248,8 +227,7 @@
}, 1500); }, 1500);
}, },
// //
onReachBottom() { onReachBottom() {},
},
} }
</script> </script>
@ -269,28 +247,34 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
overflow: hidden; overflow: hidden;
&.active { &.active {
background: #DFEBF8; background: #DFEBF8;
} }
} }
.detail-item { .detail-item {
width: 100%; width: 100%;
background: #F0F3F7; background: #F0F3F7;
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
border-radius: 8rpx; border-radius: 8rpx;
box-sizing: border-box; box-sizing: border-box;
/deep/ .uni-forms-item__content { /deep/ .uni-forms-item__content {
justify-content: flex-end; justify-content: flex-end;
text-align: right; text-align: right;
display: flex; display: flex;
} }
/deep/ .uni-forms-item { /deep/ .uni-forms-item {
margin-bottom: 0; margin-bottom: 0;
} }
/deep/ .uni-forms-item__label { /deep/ .uni-forms-item__label {
font-size: 16px; font-size: 16px;
} }
} }
.custom-pop-head { .custom-pop-head {
width: 100%; width: 100%;
padding: 20rpx; padding: 20rpx;
@ -300,15 +284,17 @@
justify-content: space-between; justify-content: space-between;
border-bottom: 1px solid #E6E6E6; border-bottom: 1px solid #E6E6E6;
margin-bottom: 20rpx; margin-bottom: 20rpx;
.left { .left {
color: #666666; color: #666666;
} }
.title { .title {
font-size: 16px; font-size: 16px;
} }
.right { .right {
color: #2663BF; color: #2663BF;
} }
} }
</style> </style>

@ -703,6 +703,7 @@ export default {
}, },
methods: { methods: {
showInvestigationTag(v) { showInvestigationTag(v) {
console.log(v)
this.showInvestigation2 = true; this.showInvestigation2 = true;
this.showInvestigation2Item = v; this.showInvestigation2Item = v;
}, },
@ -1086,11 +1087,11 @@ export default {
console.log(res); console.log(res);
if (res.code === 200) { if (res.code === 200) {
this.$.toast("保存成功"); this.$.toast("保存成功");
// setTimeout(() => { setTimeout(() => {
// uni.navigateBack({ uni.navigateBack({
// delta: 1, // 1 delta: 1, // 1
// }); });
// }, 1000); }, 1000);
// this.data = res.result; // this.data = res.result;
// this.rname = this.data[0].name; // this.rname = this.data[0].name;

Loading…
Cancel
Save