重点排查附件处理

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>
<view>
<view class="investigation-item"
:class="investigationSelect === index ? 'active' : ''"
v-for="(item, index) in investigationList"
:key="item.name"
@click="handleSelect(item, index)"
>
<view class="investigation-item" :class="investigationSelect === index ? 'active' : ''"
v-for="(item, index) in investigationList" :key="item.name" @click="handleSelect(item, index)">
<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>
<u-popup :show="showInvestigationDetail" @close="showInvestigationDetail = false">
<view class="custom-pop-head">
@ -16,57 +13,35 @@
<view class="right" @click="investigationDetailHandle">确认</view>
</view>
<view class="box" style="max-height: 800rpx;overflow-y: auto">
<view class="investigation-item"
v-for="(item, index) in investigationDetailList"
:key="index"
style="width: 96%; padding: 0"
>
<view class="investigation-item" v-for="(item, index) in investigationDetailList" :key="index"
style="width: 96%; padding: 0">
<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">
<u-input
placeholder="请输入"
border="none"
v-model="item.standar"
inputAlign="right"
type="number"
>
<u-text
:text="item.unit"
slot="suffix"
margin="0 3px 0 0"
type="tips"
></u-text>
<uni-forms-item :label="item.name" label-width="300px"
style="display: flex;align-items: center">
<u-input placeholder="请输入" border="none" 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>
</uni-forms-item>
</view>
<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">
<u-input
placeholder="请输入"
border="none"
v-model="item.standar"
inputAlign="right"
/>
<uni-forms-item :label="item.name" label-width="300px"
style="display: flex;align-items: center">
<u-input placeholder="请输入" border="none" v-model="item.standar" inputAlign="right" />
</uni-forms-item>
</view>
<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">
<u-checkbox
v-model="item.standar"
:customStyle="{justifyContent: 'space-between'}"
:name="'sdfs'"
/>
<uni-forms-item :label="item.name" label-width="300px"
style="display: flex;align-items: center">
<u-checkbox v-model="item.standar" :customStyle="{justifyContent: 'space-between'}"
:name="'sdfs'" />
</uni-forms-item>
</view>
<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" />
<u-upload
:fileList="item.fileList"
@afterRead="(e) => afterRead(e, item)"
@delete="(e) => deletePic(e, item)"
name="1"
:maxCount="1"
></u-upload>
<uni-forms-item :label="item.name" label-position="top" label-width="300px"
style="display: flex;align-items: center" />
<u-upload :fileList="item.fileList" @afterRead="(e) => afterRead(e, item)"
@delete="(e) => deletePic(e, item)" name="1" :maxCount="1"></u-upload>
</view>
</view>
</view>
@ -76,7 +51,7 @@
</template>
<script>
export default {
export default {
//
components: {},
props: {
@ -101,14 +76,13 @@ export default {
console.log(12312312312)
// this.getData()
},
mounted(){
mounted() {
if (this.sid) {
this.getData()
}
},
//
onShow() {
},
onShow() {},
//
computed: {},
//
@ -131,6 +105,10 @@ export default {
async afterRead(event, item) {
// multiple true , file
const id = this.uuid()
if (!item.fileList) {
item.fileList = []
}
this.$forceUpdate()
item.fileList.push({
id,
...event.file,
@ -167,16 +145,18 @@ export default {
});
})
},
getData(){
getData() {
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangers', {}, 'GET').then(res => {
if(res.code == 200){
if (res.code == 200) {
this.investigationList = res.result
}
})
},
getData2(sid){
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangerInfo', {sid}, 'GET').then(res => {
if(res.code == 200){
getData2(sid) {
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangerInfo', {
sid
}, 'GET').then(res => {
if (res.code == 200) {
console.log(res.result)
this.investigationDetailList = res.result.map(item => {
switch (item.type) {
@ -199,23 +179,22 @@ export default {
})
},
//
skipPage(even){
skipPage(even) {
this.$.open(even)
},
handleSelect(item, index){
handleSelect(item, index) {
this.investigationSelect = index
this.investigationDetailTitle = item.name
this.showInvestigationDetail = true
this.getData2(item.nid)
// this.$emit('select', this.investigationSelect, this.investigationList[index])
},
investigationDetailHandle(){
investigationDetailHandle() {
this.showInvestigationDetail = false
this.$emit('select', this.investigationList[this.investigationSelect], this.investigationDetailList)
}
},
onReady() {
},
onReady() {},
//
onUnload() {
@ -228,19 +207,18 @@ export default {
}, 1500);
},
//
onReachBottom() {
},
}
onReachBottom() {},
}
</script>
<style>
page {
background:#FFFFFF;
}
page {
background: #FFFFFF;
}
</style>
<style lang="scss" scoped>
.investigation-item {
margin:0 auto 20rpx;
.investigation-item {
margin: 0 auto 20rpx;
width: 90%;
border-radius: 8rpx;
padding: 20rpx;
@ -249,29 +227,35 @@ page {
justify-content: space-between;
align-items: center;
overflow: hidden;
&.active {
background: #DFEBF8;
}
}
.detail-item {
}
.detail-item {
width: 100%;
background: #F0F3F7;
padding: 20rpx 30rpx;
border-radius: 8rpx;
box-sizing: border-box;
/deep/ .uni-forms-item__content {
justify-content: flex-end;
text-align: right;
display: flex;
}
/deep/ .uni-forms-item {
margin-bottom: 0;
}
/deep/ .uni-forms-item__label {
font-size: 16px;
}
}
.custom-pop-head {
}
.custom-pop-head {
width: 100%;
padding: 20rpx;
box-sizing: border-box;
@ -280,14 +264,17 @@ page {
justify-content: space-between;
border-bottom: 1px solid #E6E6E6;
margin-bottom: 20rpx;
.left {
color: #666666;
}
.title {
font-size: 16px;
}
.right {
color: #2663BF;
}
}
}
</style>

@ -7,65 +7,40 @@
<view class="right" @click="investigationDetailHandle">确认</view>
</view>
<view class="box" style="max-height: 800rpx;overflow-y: auto">
<view class="investigation-item"
v-for="(item, index) in investigationDetailList"
:key="index"
style="width: 96%; padding: 0"
>
<view class="investigation-item" v-for="(item, index) in investigationDetailList" :key="index"
style="width: 96%; padding: 0">
<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">
<u-input
placeholder="请输入"
border="none"
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 placeholder="请输入" border="none" 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>
</uni-forms-item>
</view>
<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">
<u-input
placeholder="请输入"
border="none"
v-model="item.standar"
inputAlign="right"
/>
<u-input placeholder="请输入" border="none" v-model="item.standar" inputAlign="right" />
</uni-forms-item>
</view>
<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">
<u-checkbox
v-model="item.standar"
:customStyle="{justifyContent: 'space-between'}"
:name="'sdfs'"
/>
<u-checkbox v-model="item.standar" :customStyle="{justifyContent: 'space-between'}"
:name="'sdfs'" />
</uni-forms-item>
</view>
<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" />
<u-upload
:fileList="item.fileList"
@afterRead="(e) => afterRead(e, item)"
@delete="(e) => deletePic(e, item)"
name="1"
:maxCount="1"
></u-upload>
<uni-forms-item :label="item.name" label-position="top" label-width="300px"
style="display: flex;align-items: center" />
<u-upload :fileList="item.fileList" @afterRead="(e) => afterRead(e, item)"
@delete="(e) => deletePic(e, item)" name="1" :maxCount="1"></u-upload>
</view>
</view>
</view>
<view class="blank" />
</view>
</template>
</template>
<script>
<script>
export default {
//
components: {},
@ -94,9 +69,12 @@
onLoad(e) {
// this.getData()
},
mounted(){
mounted() {
if (this.json.name) {
this.investigationDetailList = this.json.extraConfigs.map(item => {
if (!item.fileList) {
item.fileList = []
}
switch (item.type) {
// case "1":
// item.standar = 0
@ -132,8 +110,7 @@
}
},
//
onShow() {
},
onShow() {},
//
computed: {},
//
@ -154,6 +131,7 @@
},
//
async afterRead(event, item) {
// multiple true , file
const id = this.uuid()
item.fileList.push({
@ -192,9 +170,11 @@
});
})
},
getData(){
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangerInfo', {sid: this.$props.sid}, 'GET').then(res => {
if(res.code == 200){
getData() {
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangerInfo', {
sid: this.$props.sid
}, 'GET').then(res => {
if (res.code == 200) {
this.investigationDetailList = res.result.map(item => {
switch (item.type) {
case "1":
@ -215,27 +195,26 @@
}
})
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangers', {}, 'GET').then(res => {
if(res.code == 200){
if (res.code == 200) {
this.investigationList = res.result
}
})
},
//
skipPage(even){
skipPage(even) {
this.$.open(even)
},
handleSelect(item, index){
handleSelect(item, index) {
this.investigationSelect = index
this.investigationDetailTitle = item.name
this.showInvestigationDetail = true
// this.$emit('select', this.investigationSelect, this.investigationList[index])
},
investigationDetailHandle(){
this.$emit('select',this.json)
investigationDetailHandle() {
this.$emit('select', this.json)
}
},
onReady() {
},
onReady() {},
//
onUnload() {
@ -248,19 +227,18 @@
}, 1500);
},
//
onReachBottom() {
},
onReachBottom() {},
}
</script>
</script>
<style>
<style>
page {
background:#FFFFFF;
background: #FFFFFF;
}
</style>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped>
.investigation-item {
margin:0 auto 20rpx;
margin: 0 auto 20rpx;
width: 90%;
border-radius: 8rpx;
padding: 20rpx;
@ -269,28 +247,34 @@
justify-content: space-between;
align-items: center;
overflow: hidden;
&.active {
background: #DFEBF8;
}
}
.detail-item {
width: 100%;
background: #F0F3F7;
padding: 20rpx 30rpx;
border-radius: 8rpx;
box-sizing: border-box;
/deep/ .uni-forms-item__content {
justify-content: flex-end;
text-align: right;
display: flex;
}
/deep/ .uni-forms-item {
margin-bottom: 0;
}
/deep/ .uni-forms-item__label {
font-size: 16px;
}
}
.custom-pop-head {
width: 100%;
padding: 20rpx;
@ -300,15 +284,17 @@
justify-content: space-between;
border-bottom: 1px solid #E6E6E6;
margin-bottom: 20rpx;
.left {
color: #666666;
}
.title {
font-size: 16px;
}
.right {
color: #2663BF;
}
}
</style>
</style>

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

Loading…
Cancel
Save