重点排查附件处理

main
limingtao 11 months ago
parent 94aabf89f4
commit d3ea1684ab
  1. 135
      pages/investigation/components/investigation-item.vue
  2. 110
      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>
@ -76,7 +51,7 @@
</template> </template>
<script> <script>
export default { export default {
// //
components: {}, components: {},
props: { props: {
@ -101,14 +76,13 @@ export default {
console.log(12312312312) console.log(12312312312)
// this.getData() // this.getData()
}, },
mounted(){ mounted() {
if (this.sid) { if (this.sid) {
this.getData() this.getData()
} }
}, },
// //
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,
@ -167,16 +145,18 @@ export default {
}); });
}) })
}, },
getData(){ getData() {
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangers', {}, 'GET').then(res => { this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangers', {}, 'GET').then(res => {
if(res.code == 200){ if (res.code == 200) {
this.investigationList = res.result this.investigationList = res.result
} }
}) })
}, },
getData2(sid){ getData2(sid) {
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangerInfo', {sid}, 'GET').then(res => { this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangerInfo', {
if(res.code == 200){ sid
}, 'GET').then(res => {
if (res.code == 200) {
console.log(res.result) console.log(res.result)
this.investigationDetailList = res.result.map(item => { this.investigationDetailList = res.result.map(item => {
switch (item.type) { switch (item.type) {
@ -199,23 +179,22 @@ export default {
}) })
}, },
// //
skipPage(even){ skipPage(even) {
this.$.open(even) this.$.open(even)
}, },
handleSelect(item, index){ handleSelect(item, index) {
this.investigationSelect = index this.investigationSelect = index
this.investigationDetailTitle = item.name this.investigationDetailTitle = item.name
this.showInvestigationDetail = true this.showInvestigationDetail = true
this.getData2(item.nid) this.getData2(item.nid)
// this.$emit('select', this.investigationSelect, this.investigationList[index]) // this.$emit('select', this.investigationSelect, this.investigationList[index])
}, },
investigationDetailHandle(){ investigationDetailHandle() {
this.showInvestigationDetail = false this.showInvestigationDetail = false
this.$emit('select', this.investigationList[this.investigationSelect], this.investigationDetailList) this.$emit('select', this.investigationList[this.investigationSelect], this.investigationDetailList)
} }
}, },
onReady() { onReady() {},
},
// //
onUnload() { onUnload() {
@ -228,19 +207,18 @@ export default {
}, 1500); }, 1500);
}, },
// //
onReachBottom() { onReachBottom() {},
}, }
}
</script> </script>
<style> <style>
page { page {
background:#FFFFFF; background: #FFFFFF;
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.investigation-item { .investigation-item {
margin:0 auto 20rpx; margin: 0 auto 20rpx;
width: 90%; width: 90%;
border-radius: 8rpx; border-radius: 8rpx;
padding: 20rpx; padding: 20rpx;
@ -249,29 +227,35 @@ 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;
box-sizing: border-box; box-sizing: border-box;
@ -280,14 +264,17 @@ 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;
} }
} }
</style> </style>

@ -7,65 +7,40 @@
<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>
<view class="blank" /> <view class="blank" />
</view> </view>
</template> </template>
<script> <script>
export default { export default {
// //
components: {}, components: {},
@ -94,9 +69,12 @@
onLoad(e) { onLoad(e) {
// this.getData() // this.getData()
}, },
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({
@ -192,9 +170,11 @@
}); });
}) })
}, },
getData(){ getData() {
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangerInfo', {sid: this.$props.sid}, 'GET').then(res => { this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangerInfo', {
if(res.code == 200){ sid: this.$props.sid
}, 'GET').then(res => {
if (res.code == 200) {
this.investigationDetailList = res.result.map(item => { this.investigationDetailList = res.result.map(item => {
switch (item.type) { switch (item.type) {
case "1": case "1":
@ -215,27 +195,26 @@
} }
}) })
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangers', {}, 'GET').then(res => { this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangers', {}, 'GET').then(res => {
if(res.code == 200){ if (res.code == 200) {
this.investigationList = res.result this.investigationList = res.result
} }
}) })
}, },
// //
skipPage(even){ skipPage(even) {
this.$.open(even) this.$.open(even)
}, },
handleSelect(item, index){ handleSelect(item, index) {
this.investigationSelect = index this.investigationSelect = index
this.investigationDetailTitle = item.name this.investigationDetailTitle = item.name
this.showInvestigationDetail = true this.showInvestigationDetail = true
// this.$emit('select', this.investigationSelect, this.investigationList[index]) // this.$emit('select', this.investigationSelect, this.investigationList[index])
}, },
investigationDetailHandle(){ investigationDetailHandle() {
this.$emit('select',this.json) this.$emit('select', this.json)
} }
}, },
onReady() { onReady() {},
},
// //
onUnload() { onUnload() {
@ -248,19 +227,18 @@
}, 1500); }, 1500);
}, },
// //
onReachBottom() { onReachBottom() {},
},
} }
</script> </script>
<style> <style>
page { page {
background:#FFFFFF; background: #FFFFFF;
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.investigation-item { .investigation-item {
margin:0 auto 20rpx; margin: 0 auto 20rpx;
width: 90%; width: 90%;
border-radius: 8rpx; border-radius: 8rpx;
padding: 20rpx; padding: 20rpx;
@ -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