zhangqun 11 months ago
commit 4c0cb1181a
  1. 573
      pages/investigation/components/investigation-item.vue
  2. 614
      pages/investigation/components/investigation-item2.vue
  3. 23
      pages/investigation/components/problem-tree-item.vue
  4. 108
      pages/investigation/task.vue
  5. 2
      pages/logIn/logIn.vue

@ -1,293 +1,280 @@
<template>
<view>
<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'}"/>
</view>
<u-popup :show="showInvestigationDetail" @close="showInvestigationDetail = false">
<view class="custom-pop-head">
<view class="left" @click="showInvestigationDetail = false">取消</view>
<view class="title">{{ investigationDetailTitle }}</view>
<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="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>
</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>
</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>
</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>
</view>
</view>
</view>
<view class="blank" />
</u-popup>
</view>
</template>
<script>
export default {
//
components: {},
props: {
sid: {
type: String,
default: '01'
}
},
data() {
return {
// js
$: this.$,
investigationSelect: null,
investigationList: [],
showInvestigationDetail: false,
investigationDetailTitle: '',
investigationDetailList: []
}
},
//
onLoad(e) {
console.log(12312312312)
// this.getData()
},
mounted(){
if (this.sid) {
this.getData()
}
},
//
onShow() {
},
//
computed: {},
//
methods: {
//
deletePic(event, item) {
item.fileList.splice(event.index, 1)
},
//id
uuid(len, binary) {
len = !len ? 36 : len;
binary = !binary ? 16 : binary;
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * binary | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(binary);
}).substring(0, len)
},
//
async afterRead(event, item) {
// multiple true , file
const id = this.uuid()
item.fileList.push({
id,
...event.file,
status: 'uploading',
message: '上传中'
})
const result = await this.uploadFilePromise(item.fileList[0].url)
const resultInfo = JSON.parse(result)
const index = item.fileList.findIndex(v => v.id === id)
if (resultInfo.code == 200) {
item.fileList.splice(index, 1, Object.assign(item.fileList[index], {
status: 'success',
message: '',
result: resultInfo,
url: resultInfo.result
}))
} else {
this.$.toast('上传失败')
item.fileList.splice(index, 1, Object.assign(item.fileList[index], {
status: 'error',
message: '失败',
}))
}
},
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: this.$.baseUrl + '/hiddenDanger/ftp/uploadFileToFtp', //
filePath: url,
name: 'file',
success: (res) => {
resolve(res.data)
}
});
})
},
getData(){
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangers', {}, 'GET').then(res => {
if(res.code == 200){
this.investigationList = res.result
}
})
},
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) {
case "1":
item.standar = 0
break;
case "2":
item.standar = ''
break;
case "3":
item.standar = false
break;
case "4":
item.fileList = []
break;
}
return item
})
}
})
},
//
skipPage(even){
this.$.open(even)
},
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(){
this.showInvestigationDetail = false
this.$emit('select', this.investigationList[this.investigationSelect], this.investigationDetailList)
}
},
onReady() {
},
//
onUnload() {
},
//
onPullDownRefresh() {
//
setTimeout(() => {
uni.stopPullDownRefresh();
}, 1500);
},
//
onReachBottom() {
},
}
</script>
<style>
page {
background:#FFFFFF;
}
</style>
<style lang="scss" scoped>
.investigation-item {
margin:0 auto 20rpx;
width: 90%;
border-radius: 8rpx;
padding: 20rpx;
box-sizing: border-box;
display: flex;
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;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #E6E6E6;
margin-bottom: 20rpx;
.left {
color: #666666;
}
.title {
font-size: 16px;
}
.right {
color: #2663BF;
}
}
</style>
<template>
<view>
<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'}" />
</view>
<u-popup :show="showInvestigationDetail" @close="showInvestigationDetail = false">
<view class="custom-pop-head">
<view class="left" @click="showInvestigationDetail = false">取消</view>
<view class="title">{{ investigationDetailTitle }}</view>
<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="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>
</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>
</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>
</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>
</view>
</view>
</view>
<view class="blank" />
</u-popup>
</view>
</template>
<script>
export default {
//
components: {},
props: {
sid: {
type: String,
default: '01'
}
},
data() {
return {
// js
$: this.$,
investigationSelect: null,
investigationList: [],
showInvestigationDetail: false,
investigationDetailTitle: '',
investigationDetailList: []
}
},
//
onLoad(e) {
console.log(12312312312)
// this.getData()
},
mounted() {
if (this.sid) {
this.getData()
}
},
//
onShow() {},
//
computed: {},
//
methods: {
//
deletePic(event, item) {
item.fileList.splice(event.index, 1)
},
//id
uuid(len, binary) {
len = !len ? 36 : len;
binary = !binary ? 16 : binary;
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * binary | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(binary);
}).substring(0, len)
},
//
async afterRead(event, item) {
// multiple true , file
const id = this.uuid()
if (!item.fileList) {
item.fileList = []
}
this.$forceUpdate()
item.fileList.push({
id,
...event.file,
status: 'uploading',
message: '上传中'
})
const result = await this.uploadFilePromise(item.fileList[0].url)
const resultInfo = JSON.parse(result)
const index = item.fileList.findIndex(v => v.id === id)
if (resultInfo.code == 200) {
item.fileList.splice(index, 1, Object.assign(item.fileList[index], {
status: 'success',
message: '',
result: resultInfo,
url: resultInfo.result
}))
} else {
this.$.toast('上传失败')
item.fileList.splice(index, 1, Object.assign(item.fileList[index], {
status: 'error',
message: '失败',
}))
}
},
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: this.$.baseUrl + '/hiddenDanger/ftp/uploadFileToFtp', //
filePath: url,
name: 'file',
success: (res) => {
resolve(res.data)
}
});
})
},
getData() {
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangers', {}, 'GET').then(res => {
if (res.code == 200) {
this.investigationList = res.result
}
})
},
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) {
case "1":
item.standar = 0
break;
case "2":
item.standar = ''
break;
case "3":
item.standar = false
break;
case "4":
item.fileList = []
break;
}
return item
})
}
})
},
//
skipPage(even) {
this.$.open(even)
},
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() {
this.showInvestigationDetail = false
this.$emit('select', this.investigationList[this.investigationSelect], this.investigationDetailList)
}
},
onReady() {},
//
onUnload() {
},
//
onPullDownRefresh() {
//
setTimeout(() => {
uni.stopPullDownRefresh();
}, 1500);
},
//
onReachBottom() {},
}
</script>
<style>
page {
background: #FFFFFF;
}
</style>
<style lang="scss" scoped>
.investigation-item {
margin: 0 auto 20rpx;
width: 90%;
border-radius: 8rpx;
padding: 20rpx;
box-sizing: border-box;
display: flex;
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;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #E6E6E6;
margin-bottom: 20rpx;
.left {
color: #666666;
}
.title {
font-size: 16px;
}
.right {
color: #2663BF;
}
}
</style>

@ -1,314 +1,300 @@
<template>
<view>
<view class="custom-pop-head">
<view class="left" @click="$emit('show',false)">取消</view>
<view class="title">{{ investigationDetailTitle }}</view>
<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="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>
</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>
</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>
</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>
</view>
</view>
</view>
<view class="blank" />
</view>
</template>
<script>
export default {
//
components: {},
props: {
sid: {
type: String,
default: '01'
},
json: {
type: Object,
default: {}
},
},
data() {
return {
// js
$: this.$,
investigationSelect: null,
investigationList: [],
showInvestigationDetail: false,
investigationDetailTitle: '',
investigationDetailList: []
}
},
//
onLoad(e) {
// this.getData()
},
mounted(){
if (this.json.name) {
this.investigationDetailList = this.json.extraConfigs.map(item => {
switch (item.type) {
// case "1":
// item.standar = 0
// break;
// case "2":
// item.standar = ''
// break;
// case "3":
// item.standar = false
// break;
// case "4":
// item.fileList = [
// {
// "id": "20229a8c-db46-4447-be3e-6731665f7bd0",
// "type": "image",
// "url": "https://img-blog.csdnimg.cn/20210823085628540.jpeg",
// "thumb": "blob:http://localhost:8080/4343e24a-edc5-4693-8fbd-f99647ea3bd5",
// "size": 11600,
// "name": ".png",
// "status": "success",
// "message": "",
// "result": {
// "code": 200,
// "message": "",
// "result": "https://img-blog.csdnimg.cn/20210823085628540.jpeg"
// }
// }
// ]
// break;
}
return item
})
}
},
//
onShow() {
},
//
computed: {},
//
methods: {
//
deletePic(event, item) {
item.fileList.splice(event.index, 1)
},
//id
uuid(len, binary) {
len = !len ? 36 : len;
binary = !binary ? 16 : binary;
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * binary | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(binary);
}).substring(0, len)
},
//
async afterRead(event, item) {
// multiple true , file
const id = this.uuid()
item.fileList.push({
id,
...event.file,
status: 'uploading',
message: '上传中'
})
const result = await this.uploadFilePromise(item.fileList[0].url)
const resultInfo = JSON.parse(result)
const index = item.fileList.findIndex(v => v.id === id)
if (resultInfo.code == 200) {
item.fileList.splice(index, 1, Object.assign(item.fileList[index], {
status: 'success',
message: '',
result: resultInfo,
url: resultInfo.result
}))
} else {
this.$.toast('上传失败')
item.fileList.splice(index, 1, Object.assign(item.fileList[index], {
status: 'error',
message: '失败',
}))
}
},
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: this.$.baseUrl + '/hiddenDanger/ftp/uploadFileToFtp', //
filePath: url,
name: 'file',
success: (res) => {
resolve(res.data)
}
});
})
},
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":
item.standar = 0
break;
case "2":
item.standar = ''
break;
case "3":
item.standar = false
break;
case "4":
item.fileList = []
break;
}
return item
})
}
})
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangers', {}, 'GET').then(res => {
if(res.code == 200){
this.investigationList = res.result
}
})
},
//
skipPage(even){
this.$.open(even)
},
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)
}
},
onReady() {
},
//
onUnload() {
},
//
onPullDownRefresh() {
//
setTimeout(() => {
uni.stopPullDownRefresh();
}, 1500);
},
//
onReachBottom() {
},
}
</script>
<style>
page {
background:#FFFFFF;
}
</style>
<style lang="scss" scoped>
.investigation-item {
margin:0 auto 20rpx;
width: 90%;
border-radius: 8rpx;
padding: 20rpx;
box-sizing: border-box;
display: flex;
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;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #E6E6E6;
margin-bottom: 20rpx;
.left {
color: #666666;
}
.title {
font-size: 16px;
}
.right {
color: #2663BF;
}
}
</style>
<template>
<view>
<view class="custom-pop-head">
<view class="left" @click="$emit('show',false)">取消</view>
<view class="title">{{ investigationDetailTitle }}</view>
<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="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>
</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" />
</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'" />
</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>
</view>
</view>
</view>
<view class="blank" />
</view>
</template>
<script>
export default {
//
components: {},
props: {
sid: {
type: String,
default: '01'
},
json: {
type: Object,
default: {}
},
},
data() {
return {
// js
$: this.$,
investigationSelect: null,
investigationList: [],
showInvestigationDetail: false,
investigationDetailTitle: '',
investigationDetailList: []
}
},
//
onLoad(e) {
// this.getData()
},
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
// break;
// case "2":
// item.standar = ''
// break;
// case "3":
// item.standar = false
// break;
// case "4":
// item.fileList = [
// {
// "id": "20229a8c-db46-4447-be3e-6731665f7bd0",
// "type": "image",
// "url": "https://img-blog.csdnimg.cn/20210823085628540.jpeg",
// "thumb": "blob:http://localhost:8080/4343e24a-edc5-4693-8fbd-f99647ea3bd5",
// "size": 11600,
// "name": ".png",
// "status": "success",
// "message": "",
// "result": {
// "code": 200,
// "message": "",
// "result": "https://img-blog.csdnimg.cn/20210823085628540.jpeg"
// }
// }
// ]
// break;
}
return item
})
}
},
//
onShow() {},
//
computed: {},
//
methods: {
//
deletePic(event, item) {
item.fileList.splice(event.index, 1)
},
//id
uuid(len, binary) {
len = !len ? 36 : len;
binary = !binary ? 16 : binary;
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * binary | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(binary);
}).substring(0, len)
},
//
async afterRead(event, item) {
// multiple true , file
const id = this.uuid()
item.fileList.push({
id,
...event.file,
status: 'uploading',
message: '上传中'
})
const result = await this.uploadFilePromise(item.fileList[0].url)
const resultInfo = JSON.parse(result)
const index = item.fileList.findIndex(v => v.id === id)
if (resultInfo.code == 200) {
item.fileList.splice(index, 1, Object.assign(item.fileList[index], {
status: 'success',
message: '',
result: resultInfo,
url: resultInfo.result
}))
} else {
this.$.toast('上传失败')
item.fileList.splice(index, 1, Object.assign(item.fileList[index], {
status: 'error',
message: '失败',
}))
}
},
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: this.$.baseUrl + '/hiddenDanger/ftp/uploadFileToFtp', //
filePath: url,
name: 'file',
success: (res) => {
resolve(res.data)
}
});
})
},
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":
item.standar = 0
break;
case "2":
item.standar = ''
break;
case "3":
item.standar = false
break;
case "4":
item.fileList = []
break;
}
return item
})
}
})
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangers', {}, 'GET').then(res => {
if (res.code == 200) {
this.investigationList = res.result
}
})
},
//
skipPage(even) {
this.$.open(even)
},
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)
}
},
onReady() {},
//
onUnload() {
},
//
onPullDownRefresh() {
//
setTimeout(() => {
uni.stopPullDownRefresh();
}, 1500);
},
//
onReachBottom() {},
}
</script>
<style>
page {
background: #FFFFFF;
}
</style>
<style lang="scss" scoped>
.investigation-item {
margin: 0 auto 20rpx;
width: 90%;
border-radius: 8rpx;
padding: 20rpx;
box-sizing: border-box;
display: flex;
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;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #E6E6E6;
margin-bottom: 20rpx;
.left {
color: #666666;
}
.title {
font-size: 16px;
}
.right {
color: #2663BF;
}
}
</style>

@ -50,7 +50,8 @@ export default {
$: this.$,
originList: [],
problemTreeSelect: null,
problemTreeSelectList: [],
problemTreeSelectList: [],
problemTreeSelectAllList: [],
problemTreeSelectConfirmList: [],
};
},
@ -74,14 +75,15 @@ export default {
.globalRequest("/hiddenDanger/highDanger/getDangerItems", {}, "GET")
.then((res) => {
if (res.code == 200) {
this.originList = res.result;
this.problemTreeSelectList = res.result;
if(this.hiddenDangerList2.length>0) {
this.problemTreeSelectConfirmList = this.hiddenDangerList2
console.log(this.hiddenDangerList2)
this.problemTreeSelectList = this.hiddenDangerList2[1].children
this.problemTreeSelect = this.hiddenDangerList2[2].id
}
this.originList =JSON.parse(JSON.stringify( res.result));
this.problemTreeSelectList =JSON.parse(JSON.stringify( res.result));
this.problemTreeSelectAllList=JSON.parse(JSON.stringify( res.result))
// if(this.hiddenDangerList2.length>0) {
// // this.problemTreeSelectConfirmList = this.hiddenDangerList2
// console.log(this.hiddenDangerList2)
// this.problemTreeSelectList = this.hiddenDangerList2[1].children
// this.problemTreeSelect = this.hiddenDangerList2[2].id
// }
}
});
},
@ -89,7 +91,8 @@ export default {
skipPage(even) {
this.$.open(even);
},
handleSelectProblem(item, index) {
handleSelectProblem(item, index) {
console.log(11111)
this.problemTreeSelectConfirmList[Number(item.nlevel) - 1] = item;
if (item.children && item.children.length > 0) {
this.problemTreeSelectList = item.children;

@ -376,7 +376,7 @@
<view class="title">存在隐患</view>
<u-row :gutter="0" justify="flex-start" style="flex-wrap: wrap">
<view
v-for="item in hiddenDangerList"
v-for="(item,index) in hiddenDangerList"
:key="item"
style="width: 100%"
>
@ -386,7 +386,7 @@
{{ item.dangerProblem }}
</view>
<view>
<view class="check" @click="onHiddenDangerList(item)">
<view class="check" @click="onHiddenDangerList(item,index)">
<image
style="width: 10px; height: 16px"
src="../../static/scimg/right6.png"
@ -438,11 +438,10 @@
label-width="100px"
style="display: flex; align-items: center"
/>
<view v-if="this.hiddenDangerList2.length > 0"
>{{ this.hiddenDangerList2[0].itemname }}/{{
this.hiddenDangerList2[1].itemname
}}/{{ this.hiddenDangerList2[2].itemname }}</view
<view v-if="hiddenDangerList2.length > 0"
>{{ hiddenDangerList2[0].itemname }}/{{
hiddenDangerList2[1].itemname
}}/{{ hiddenDangerList2[2].itemname }}</view
>
<!-- <u-input
@ -451,8 +450,8 @@
type="textarea"
v-else
/> -->
<view v-else-if="this.dangerProblem">{{
this.dangerProblem
<view v-else-if="dangerProblem">{{
dangerProblem
}}</view>
<view v-else>请选择</view>
<!-- -->
@ -474,7 +473,8 @@
label="隐患图片"
label-position="top"
label-width="200px"
/>
/>
<u-upload
:fileList="fileList"
@afterRead="(e) => afterRead(e, 'fileList')"
@ -693,11 +693,17 @@ export default {
hiddenDangerList: [],
hiddenDangerList2: [],
hiddenDangerList3: [],
dangerProblem: "",
dangerProblem: "",
//
addInvestigationInfo:{
type:'',
index:0
}
};
},
methods: {
showInvestigationTag(v) {
showInvestigationTag(v) {
console.log(v)
this.showInvestigation2 = true;
this.showInvestigation2Item = v;
},
@ -726,8 +732,11 @@ export default {
this.showInvestigation2Item = {};
this.showInvestigation2 = false;
},
onHiddenDangerList(v) {
console.log(this.problemTreeSelectConfirmList)
onHiddenDangerList(v,index) {
this.addInvestigationInfo={
type:'edit',
index:index
}
this.showProblem = true;
this.dangerProblem = v.dangerProblem;
this.describe = {
@ -737,11 +746,23 @@ export default {
hdDesc: v.hdDesc,
hdPic: v.hdPic,
hdInfo: v.hdInfo,
};
// this.fileList = [v.hdPic];
};
console.log(v)
let newArr=[]
try{
newArr= v.dangerProblem.split('/')
}catch(e){
newArr=['','','']
}
this.hiddenDangerList2=[{id:v.bigCategory,itemname:newArr[0]},
{id:v.smallCategory,itemname:newArr[1]},
{id:v.hdTerm,itemname:newArr[2]}]
// console.log(this.hiddenDangerList2)
this.fileList = [{url:v.hdPic}];
},
add() {
add() {
// this.addInvestigationInfo.type='add'
this.$set(this.addInvestigationInfo,'type','add')
this.showProblem = true;
this.hiddenDangerList2 = [];
this.dangerProblem = '';
@ -867,7 +888,8 @@ export default {
this.hiddenDangerList2 = JSON.parse(
JSON.stringify(this.hiddenDangerList3)
);
}
}
console.log(this.hiddenDangerList2)
},
select(v) {
@ -911,18 +933,27 @@ export default {
this.$.toast("已添加");
}
},
investigationHandle2() {
this.hiddenDangerList.push({
bigCategory: this.hiddenDangerList2[0].id,
bigCategoryName: this.hiddenDangerList2[0].itemname,
smallCategory: this.hiddenDangerList2[1].id,
smallCategoryName: this.hiddenDangerList2[1].itemname,
hdTerm: this.hiddenDangerList2[2].id,
hdTermName: this.hiddenDangerList2[2].itemname,
hdDesc: this.describe.hdDesc,
hdPic: this.fileList.url,
hdInfo: this.describe.hdInfo,
});
investigationHandle2() {
if(this.hiddenDangerList2.length>0){
let form={
bigCategory: this.hiddenDangerList2[0].id,
bigCategoryName: this.hiddenDangerList2[0].itemname,
smallCategory: this.hiddenDangerList2[1].id,
smallCategoryName: this.hiddenDangerList2[1].itemname,
hdTerm: this.hiddenDangerList2[2].id,
hdTermName: this.hiddenDangerList2[2].itemname,
hdDesc: this.describe.hdDesc,
hdPic: this.fileList.length>0?this.fileList[0].url:'',
hdInfo: this.describe.hdInfo,
dangerProblem:this.hiddenDangerList2[0].itemname+'/'+ this.hiddenDangerList2[1].itemname+'/'+ this.hiddenDangerList2[2].itemname
}
if(this.addInvestigationInfo.type=='add'){
this.hiddenDangerList.push(form);
}else{
this.$set(this.hiddenDangerList,this.addInvestigationInfo.index,form)
}
}
this.showProblem = false;
},
investigationDetailHandle() {
@ -1003,7 +1034,8 @@ export default {
result: resultInfo,
url: resultInfo.result,
})
);
);
console.log(this[key])
} else {
this.$.toast("上传失败");
this[key].splice(
@ -1019,7 +1051,13 @@ export default {
submit(temporary) {
console.log(this.formData);
console.log(this.investigationSelectList);
console.log(this.hiddenDangerList);
console.log({
...this.formData,
businessId: this.businessId,
extraConfigs: extraConfigs,
describe: this.hiddenDangerList,
temporary,
});
let extraConfigs = [];
this.investigationSelectList.map((r) => {
r.extraConfigs.map((s) => {
@ -1309,7 +1347,9 @@ export default {
.problem-box {
width: 100%;
padding: 20rpx;
box-sizing: border-box;
box-sizing: border-box;
max-height: calc(100vh - 100px);
overflow: auto;
.detail-item {
margin-bottom: 20rpx;
}

@ -167,7 +167,7 @@ export default {
this.isDisabled = true
this.$request.globalRequest(url, datas, 'POST').then(res => {
if(res.code === 200){
this.$.toast('成功')
this.$.toast('登录成功')
this.$.setData('token',res.result)
this.$.setData('userInfo', { username: res.result })
setTimeout(() => {

Loading…
Cancel
Save