李神峰 2024-11-07 16:41:21 +08:00
commit 208e678f23
18 changed files with 2143 additions and 100 deletions

View File

@ -127,6 +127,42 @@
"navigationBarTitleText": ""
}
},
{
"path": "pages/mypage/compents/wtcl/index",//
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/mypage/compents/wxyh/index",//
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/mypage/compents/wxyh/formZdy/index",//
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/mypage/compents/xcrw/index",//
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/mypage/compents/wtcl/detail/index",//
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/mypage/compents/xcrw/detail/index",//
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/personInfo/personInfo",
"style": {

View File

@ -0,0 +1,278 @@
<template>
<view :style="{height:'100vh',overflow:'auto'}">
<u-status-bar></u-status-bar>
<u-navbar title="问题处理" :autoBack="true" :titleStyle="{
fontSize:'18px'
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar>
<view class="" style="margin-top: 44px;;background-color: #f0f0f0;border-top: 1px solid #f0f0f0;">
<view style="margin: 10px;background-color: #fff;padding: 10px;">
<view class="item">
<view class="blueTiao">
</view>
<view class="title">
巡检问题信息
</view>
</view>
<view class="contentItem">
<view class="itemC">
<text>巡查人</text>
<text>{{queItem.inspectUserName}}</text>
</view>
<view class="itemC">
<text>巡查时间</text>
<text>{{queItem.finishTime}}</text>
</view>
<view class="itemC">
<text>任务标题</text>
<text>{{queItem.taskTitle}}</text>
</view>
<view class="itemC">
<text>巡检点</text>
<text>{{queItem.name}}</text>
</view>
<view class="itemC">
<text>巡检项</text>
<text>{{queItem.itemDesc}}</text>
</view>
<view class="itemNo" style="flex-direction: column;">
<text>巡检问题描述</text>
<u--textarea v-model="queItem.problemDesc" placeholder="请输入内容" disabled ></u--textarea>
</view>
<view class="itemNo" style="flex-direction: column;">
<text>巡检图片</text>
<view class="">
</view>
</view>
<view class="itemNo" style="flex-direction: column;">
<text>巡检视频</text>
<view class="">
</view>
</view>
</view>
</view>
<view style="margin: 10px;background-color: #fff;padding: 10px;" class="">
<u--form labelPosition="left" :model="o" ref="uForm" label-width='80px'>
<view class="itemCc">
<u-form-item label="处理人" prop="handleUserName" borderBottom required >
<u--input v-model="queItem.handleUserName" disabled disabledColor="#ffffff"
placeholder="" border="none"></u--input>
</u-form-item>
<u-form-item label="处理时间" prop="handleTime" borderBottom required>
<u--input v-model="queItem.handleTime" disabled disabledColor="#ffffff"
placeholder="" border="none"></u--input>
</u-form-item>
<u-form-item label="处理内容" prop="handleDesc" borderBottom required labelPosition='top'>
<u--textarea v-model="queItem.handleDesc" disabled placeholder="请输入内容" ></u--textarea>
</u-form-item>
<u-form-item label="处理图片" prop="handlePics" borderBottom required labelPosition='top'>
<u-upload accept="image" :fileList="queItem.handlePics || []" disabled
@afterRead="(e)=>afterRead(e,queItem)"
@delete="(e)=>deletePic(e,queItem)" name="handlePics" multiple
:maxCount="10"></u-upload>
</u-form-item>
<u-form-item label="处理视频" prop="handleVideos" borderBottom labelPosition='top'>
<u-upload accept="video" :fileList="queItem.handleVideos" disabled
@afterRead="(e)=>afterRead(e,queItem)"
@delete="(e)=>deletePic(e,queItem)" name="handleVideos" multiple
:maxCount="10"></u-upload>
</u-form-item>
</view>
</u--form>
</view>
</view>
</view>
</view>
</template>
<script>
import moment from 'moment'
export default {
data() {
return {
show: false,
model: {
stm: '',
etm: ''
},
customStyle: {
background: '#000'
},
queItem:{},
list: [
]
};
},
onLoad(options) {
this.queItem = JSON.parse(options.item)
console.log(this.queItem);
},
methods: {
submit(){
//
if(this.queItem.handlePics?.length < 0 || !this.queItem.handleDesc){
console.log(this.queItem);
uni.$showMsg('请填写处理内容和上传图片');
return;
}else{
console.log(this.queItem);
uni.$http.post('/gunshiApp/xyt/inspect/detail/handle', this.queItem).then(res => {
uni.$showMsg(res.data.description);
})
}
},
//
deletePic(event, o) {
this.queItem[event.name].splice(event.index, 1)
},
//
async afterRead(event, o) {
// let file
// multiple true , file
console.log(event,'2342132');
let lists = [].concat(event.file)
if(!this.queItem[event.name]){
this.queItem[event.name]=[]
}
let fileListLen = this.queItem[event.name]?.length
console.log(this.queItem[event.name]);
lists.map((item) => {
this.queItem[event.name].push({
...item,
status: 'uploading',
message: '上传中'
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url, event.name)
console.log(result);
let item = this.queItem[event.name][fileListLen]
this.queItem[event.name].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
...result
}))
fileListLen++
}
},
uploadFilePromise(url, name) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: 'http://local.gunshiiot.com:18083/gunshiApp/xyt/maintain/service/file/upload/singleSimple', //
filePath: url,
name: 'file',
formData: {
user: 'test'
},
success: (res) => {
setTimeout(() => {
// this.listData[index].children[index1][name].push({...res.data.data,url:res.data.data.filePath})
console.log(res.data)
resolve(JSON.parse(res.data).data)
}, 1000)
}
});
// resolve(a)
})
},
confirm(e) {
console.log(e);
this.model.stm = e[0]
this.model.etm = e[1]
this.show = false
},
cancel() {
this.show = false
}
}
}
</script>
<style lang="scss" scoped>
.myTitleStyle {
font-size: 30px;
background-color: red;
height: 200px;
}
.tabsClass {
margin-top: 44px;
height: 44px;
padding: 0 40px;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
}
.item {
padding-bottom: 10px;
display: flex;
align-items: center;
// justify-content: space-between;
.blueTiao{
background-color: #007aff;
width: 5px;
height: 16px;
margin-right: 10px;
}
.title {
border-width: 0px;
font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑', sans-serif;
font-weight: 700;
font-style: normal;
font-size: 15px;
color: #666666
}
.titleRight {
display: flex;
.border {
border-width: 0px;
background-color: rgba(236, 245, 255, 1);
box-sizing: border-box;
border-width: 1px;
border-style: solid;
border-color: rgba(187, 220, 255, 1);
border-radius: 5px;
box-shadow: none;
width: 58px;
height: 25px;
color: #689FFF;
text-align: center;
}
}
}
.itemCc{
// display: flex;
// justify-content: space-between;
// display: flex;
padding: 10px;
border-bottom: 1px solid #f0f0f0;
}
.contentItem{
.itemC{
display: flex;
justify-content: space-between;
display: flex;
color: #303133;;
padding: 10px;
border-bottom: 1px solid #f0f0f0;
}
.itemNo{
color: #303133;;
padding: 10px;
}
}
</style>

View File

@ -0,0 +1,209 @@
<template>
<view :style="{height:'100vh',overflow:'hidden'}">
<u-status-bar></u-status-bar>
<u-navbar title="预警" :autoBack="true" :titleStyle="{
fontSize:'18px'
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar>
<view class="" style="margin-top: 44px;;background-color: #f0f0f0;border-top: 1px solid #f0f0f0;overflow: auto;">
<view style="padding:0 10px;backgroundColor:#fff">
<view class="time-ranger">
<view class="start-time">
<text>开始时间</text>
<text @click="showTime=true" style="margin-left:15%;color:#3399ef">{{startTime}}</text>
</view>
<view class="end-time">
<text>结束时间</text>
<text @click="showTime1=true" style="margin:0 15%;color:#3399ef">{{endTime}}</text>
<view class="search-btn" @click="searchTm">
搜索
</view>
</view>
</view>
</view>
<view class="" v-for="item in list" style="margin: 10px;background-color: #fff;padding: 10px;">
<view class="item">
<!-- {{item.title}} -->
<view class="title">
{{item.taskTitle}}
</view>
<view class="titleRight" @click="toDetail(item)">
<view class="border">
{{item.isHandle==1?'已处理':'待处理'}}
</view>
<u-icon name="arrow-right" size="20"></u-icon>
</view>
</view>
<view class="contentItem">
<view class="itemC">
<text>巡检项</text>
<text>{{item.itemDesc}}</text>
</view>
<view class="itemC">
<text>巡查人</text>
<text>{{item.inspectUserName}}</text>
</view>
<view class="itemC">
<text>巡查时间</text>
<text>{{item.finishTime}}</text>
</view>
</view>
</view>
</view>
<u-datetime-picker :show="showTime" v-model="stm" mode="datetime" @confirm="showTime=false"
@cancel="showTime=false"></u-datetime-picker>
<u-datetime-picker :show="showTime1" v-model="etm" mode="datetime" @confirm="showTime1=false"
@cancel="showTime1=false"></u-datetime-picker>
</view>
</template>
<script>
import moment from 'moment'
export default {
data() {
return {
show: false,
showTime:false,
showTime1:false,
start: '请选择开始时间',
end: '请选择结束时间',
stm:'',
etm:'',
customStyle: {
background: '#000'
},
list: [
]
};
},
onLoad() {
this.getList()
},
computed:{
startTime:function (){
return this.stm?moment(this.stm).format('YYYY-MM-DD HH:mm:ss'):this.start
},
endTime:function (){
return this.etm?moment(this.etm).format('YYYY-MM-DD HH:mm:ss'):this.end
}
},
methods: {
searchTm(){
this.getList()
},
getList() {
console.log(uni.getStorageSync('value'));
let params = {
"pageSo": {
"pageSize": 10,
"pageNumber": 1
},
"dateTimeRangeSo": {
start:this.stm?moment(this.stm).format('YYYY-MM-DD HH:mm:ss'):'',
end:this.etm?moment(this.etm).format('YYYY-MM-DD HH:mm:ss'):''
},
"isHandle": 1,
"inspectUserId": uni.getStorageSync('value').userId
}
uni.$http.post('/gunshiApp/xyt/inspect/detail/page', params).then(res => {
this.list=res.data.data.records
})
},
confirm(e) {
console.log(e);
this.model.start = e[0]
this.model.end = e[1]
this.show = false
},
cancel() {
this.show = false
},
toDetail(item) {
uni.navigateTo({
url: '/pages/mypage/compents/wtcl/detail/index?item='+JSON.stringify(item)
})
}
}
}
</script>
<style lang="scss" scoped>
.time-ranger {
margin-bottom: 10px;
.start-time,
.end-time {
display: flex;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #dfdfdf;
}
.search-btn {
margin: 3px 0 0 5px;
// color: #3399ef;
}
}
.myTitleStyle {
font-size: 30px;
background-color: red;
height: 200px;
}
.tabsClass {
margin-top: 44px;
height: 44px;
padding: 0 40px;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
}
.item {
border-bottom: 1px solid #f0f0f0;
padding-bottom: 10px;
display: flex;
justify-content: space-between;
.title {
border-width: 0px;
font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑', sans-serif;
font-weight: 700;
font-style: normal;
font-size: 15px;
color: #666666
}
.titleRight {
display: flex;
.border {
border-width: 0px;
background-color: rgba(236, 245, 255, 1);
box-sizing: border-box;
border-width: 1px;
border-style: solid;
border-color: rgba(187, 220, 255, 1);
border-radius: 5px;
box-shadow: none;
width: 58px;
height: 25px;
color: #689FFF;
text-align: center;
}
}
}
.contentItem {
.itemC {
display: flex;
justify-content: space-between;
display: flex;
color: #666666;
padding: 10px;
}
}
</style>

View File

@ -0,0 +1,155 @@
<template>
<view>
<!-- 注意如果需要兼容微信小程序最好通过setRules方法设置rules规则 -->
<u--form labelPosition="left" :model="model1" ref="uForm" >
<u-form-item label="管护类型" prop="maintainType" borderBottom ref="item1"
required
labelPosition='top'
labelWidth="100px">
<u--input v-model="model1.maintainName" disabled disabledColor="#ffffff" placeholder="请选择管护类型"
border="none" ></u--input>
</u-form-item>
<u-form-item label="内容说明" prop="maintainContent" borderBottom labelPosition='top' required labelWidth="100px">
<u--textarea v-model="model1.maintainContent" placeholder="请输入内容" disabled></u--textarea>
</u-form-item>
<u-form-item label="现场图片" prop="fileListpics" borderBottom labelPosition='top' labelWidth="100px">
<u-upload :fileList="fileListpics" @afterRead="afterRead" @delete="deletePic" name="pics" multiple disabled
multiple accept='image' :maxCount="10"></u-upload>
</u-form-item>
<u-form-item label="现场视频" prop="fileListvideos" borderBottom labelPosition='top' labelWidth="100px">
<u-upload :fileList="fileListvideos" @afterRead="afterRead" @delete="deletePic" name="videos" multiple disabled
multiple accept='video' :maxCount="10"></u-upload>
</u-form-item>
</u--form>
</view>
</template>
<script>
export default {
props:{
formData:Object
},
data() {
return {
showSex: false,
fileListpics: [],
fileListvideos: [],
model1: {
maintainContent: "",
maintainType: '',
pics: [],
videos: []
},
actions: [{
value: 1,
name: "溢洪道清障"
},
{
value: 2,
name: "除草除杂"
},
{
value: 3,
name: "设备养护"
},
{
value: 4,
name: "环境清洁"
},
{
value: 5,
name: "危险提示"
},
{
value: 6,
name: "其他"
},
],
radio: '',
switchVal: false
};
},
mounted() {
this.model1 = this.formData
this.model1.maintainName = this.actions.find(item=>item.value == this.formData.maintainType).name
this.model1.fileListpics = this.formData.pic
this.model1.fileListvideos = this.formData.videos
},
methods: {
sexSelect(e) {
this.model1.maintainType = e.name
this.$refs.uForm.validateField('maintainType')
},
submit() {
this.$refs.uForm.validate().then(res => {
let params = {
...this.model1,
maintainType: this.actions.find(item => item.name == this.model1.maintainType).value,
}
this.$emit('submitForm', params)
}).catch(errors => {
uni.$u.toast('校验失败')
})
},
//
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
//
async afterRead(event) {
// multiple true , file
let lists = [].concat(event.file)
console.log(`fileList${event.name}`,event);
let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
status: 'uploading',
message: '上传中'
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url,event.name)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
}
},
uploadFilePromise(url,name) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: 'http://local.gunshiiot.com:18083/gunshiApp/xyt/maintain/service/file/upload/singleSimple', //
filePath: url,
name: 'file',
formData: {
user: 'test'
},
success: (res) => {
setTimeout(() => {
// const obj = this.model1[name].find(item=>item.fileId==res.data.data.fileId)
// if(obj){
// }
console.log(JSON.parse(res.data),this.model1,name);
this.model1[name].push({fileId:JSON.parse(res.data).data.fileId})
resolve(res.data.data)
}, 1000)
}
});
})
},
},
onReady() {
//setRules
this.$refs.uForm.setRules(this.rules)
},
};
</script>

View File

@ -0,0 +1,38 @@
<template>
<view>
<!-- 注意如果需要兼容微信小程序最好通过setRules方法设置rules规则 -->
<u--form labelPosition="left" :model="formData" label-width='80px'>
<u-form-item label="上报人" prop="reportUserName" borderBottom ref="item1">
<u--input v-model="formData.reportUserName" border="none" disabled></u--input>
</u-form-item>
<u-form-item label="上报时间" prop="reportTime" borderBottom ref="item1">
<u--input v-model="formData.reportTime" border="none" disabled></u--input>
</u-form-item>
</u--form>
</view>
</template>
<script>
import moment from 'moment';
export default {
props:{
formData:Object
},
data() {
return {
// formData: {
// reportUserName:uni.getStorageSync('value').userName,
// reportTime:moment().format('YYYY-MM-DD HH:mm:ss'),
// userId:uni.getStorageSync('value').userId
// },
};
},
onShow() {
// debugger;
// const userList=uni.getStorageSync('value')
// console.log(userList,'3456789045678945678');
// this.formData.reportUserName = uni.getStorageSync('value').userName
// this.formData.userId = uni.getStorageSync('value').userId
},
};
</script>

View File

@ -0,0 +1,74 @@
<template>
<view>
<u-navbar
title="维修养护"
:autoBack="true"
:titleStyle="{
fontSize:'18px'
}"
:height='44'
:safeAreaInsetTop=true
leftIconSize='20'
leftIconColor='rgb(153, 153, 153)'
>
</u-navbar>
<view
style="background-color: #f0f0f0;padding: 10px;overflow: auto;margin-top: 44px;">
<view class="content">
<formTop labelWidth="150rpx" :formData="formData"/>
</view>
<view class="content" style="margin-top: 10px;">
<formBottom labelWidth="150rpx" @submitForm='submitForm' :formData="formData"/>
</view>
</view>
<!-- <button @click="submitForm">Submit</button> -->
</view>
</template>
<script>
import formTop from './formTop.vue'
import formBottom from './formBottom.vue'
import moment from 'moment'
export default {
components: { formTop,formBottom },
data() {
return {
formData: {
reportUserName:'',
reportTime:moment().format('YYYY-MM-DD HH:mm:ss'),
userId:''
},
}
},
onLoad(options) {
this.formData=JSON.parse(options.item)
},
methods: {
submitForm(params) {
//
console.log({...params,...this.formData});
uni.$http.post('/gunshiApp/xyt/maintain/service/insert',{...params,...this.formData}).then(res=>{
if(res.data.code == 200){
uni.$u.toast('新增成功')
uni.navigateBack()
}
})
},
goBack() {
console.log(12121);
uni.navigateBack()
},
}
}
</script>
<style>
.content {
/* margin: 10px; */
padding: 10px;
/* width: 95%; */
background-color: #fff;
}
</style>

View File

@ -0,0 +1,135 @@
<template>
<view>
<u-navbar title="维修养护" :autoBack="true" :titleStyle="{
fontSize:'18px'
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar>
<view style="background-color: #f0f0f0;padding: 10px;overflow: auto;margin-top: 44px;">
<view class="" v-for="item in dataList" class="contentItemWx" @click="toDetail(item)">
<view class="contentItem">
<view class="itemWxyhT">
<text>{{type[item.maintainType]}}</text>
<uni-icons type="right"></uni-icons>
</view>
<view class="itemWxyhB">
<text>{{item.reportTime}}</text>
</view>
</view>
</view>
<!-- <view class="content">
<formTop labelWidth="150rpx" />
</view> -->
<!-- <view class="content" style="margin-top: 10px;">
<formBottom labelWidth="150rpx" @submitForm='submitForm'/>
</view> -->
</view>
<!-- <button @click="submitForm">Submit</button> -->
</view>
</template>
<script>
import formTop from './formZdy/formTop.vue'
import formBottom from './formZdy/formBottom.vue'
import moment from 'moment'
export default {
components: {
formTop,
formBottom
},
data() {
return {
formData: {
reportUserName: '',
reportTime: moment().format('YYYY-MM-DD HH:mm:ss'),
userId: ''
},
dataList: [],
type: {
1: "溢洪道清障",
2: "除草除杂",
3: "设备养护",
4: "环境清洁",
5: "危险提示",
6: "其他",
},
}
},
onShow() {
this.getList()
},
methods: {
toDetail(item){
uni.navigateTo({
url:'/pages/mypage/compents/wxyh/formZdy/index?item='+JSON.stringify(item)
})
},
getList() {
let params = {
"pageSo": {
"pageSize": 10,
"pageNumber": 1
},
"dateTimeSo": {
"start": "2023-11-06 00:00:00",
"end": "2024-11-06 00:00:00"
}
}
uni.$http.post('/gunshiApp/xyt/maintain/service/page', params).then(res => {
this.dataList = res.data.data.records
})
},
submitForm(params) {
//
console.log({
...params,
...this.formData
});
uni.$http.post('/gunshiApp/xyt/maintain/service/insert', {
...params,
...this.formData
}).then(res => {
if (res.data.code == 200) {
uni.$u.toast('新增成功')
uni.navigateBack()
}
})
},
goBack() {
console.log(12121);
uni.navigateBack()
},
}
}
</script>
<style>
.content {
/* margin: 10px; */
padding: 10px;
/* width: 95%; */
background-color: #fff;
}
.itemWxyhT {
display: flex;
justify-content: space-between;
font-family: "微软雅黑 Bold", "微软雅黑 Regular", 微软雅黑, sans-serif;
font-weight: 700;
font-style: normal;
font-size: 15px;
color: rgb(102, 102, 102);
padding-bottom: 10px;
border-bottom: 1px solid #f0f0f0;
}
.itemWxyhB{
color: rgba(127, 127, 127, 0.8);
padding-top: 10px;
}
.contentItemWx{
background-color: rgba(255, 255, 255, 1);
padding: 10px;
margin-bottom: 10px;
}
</style>

View File

@ -0,0 +1,394 @@
<template>
<view class="contentItem">
<uni-collapse>
<uni-collapse-item title-border="none" v-for="(item,index) in listData" :key="index" :border="false"
:show-animation="true">
<template v-slot:title>
<view style="display: flex;align-items: center;">
<text class="yuandian"></text>
<text>{{item.name}}</text>
</view>
</template>
<view class="xj-content">
<view class="xj-text" v-for="(o,i) in item.children" :key="i">
<view style="display: flex;align-items: center;">
<text>{{o.itemDesc}}</text>
<text>{{o.isNormal == 0?'异常':'正常'}}{{o.isHandle?'已处理':'未处理'}}</text>
</view>
<view class="" v-if="o.isNormal == 0">
<view style="">
<text>现场图片</text>
<view class="" v-for="item in o.inspectPics">
<image :src="item.url" style="width: 80px;height: 80px;margin: 5px;" ></image>
</view>
</view>
<view v-if="o.inspectVideos.length">
<text>现场视频</text>
<view class="" v-for="item in o.inspectVideos">
<video :src="item.url" style="width: 80px;height: 80px;margin: 5px;" show-fullscreen-btn :show-progress='false'></video>
</view>
</view>
<view style="display: flex;justify-content: space-between;">
<text>问题描述</text>
<text>{{o.itemProblemDesc}}</text>
</view>
</view>
<view class="" v-if="o.isHandle == 1">
<view style="">
<text>处理图片</text>
<view class="" v-for="item in o.handlePics">
<image :src="item.url" style="width: 80px;height: 80px;margin: 5px;"></image>
</view>
</view>
<view style="" v-if="o.handleVideos.length">
<text>处理视频</text>
<view class="" v-for="item in o.handleVideos">
<video :src="item.url" style="width: 80px;height: 80px;margin: 5px;" show-fullscreen-btn></video>
</view>
</view>
<view style="display: flex;justify-content: space-between;">
<text>问题描述</text <text>{{o.handleDesc}}</text>
</view>
</view>
<view style="display: flex;justify-content: space-between;" v-if="o.isHandle == 0">
<text>责任人</text>
<text>{{o.handleUserName}}</text>
</view>
<view class="subsectioin">
<!-- <u--form labelPosition="left" :model="o" ref="uForm">
<u-form-item label="状态" prop="isNormal" borderBottom required>
<u-subsection :list="list" :current="getNormal(o.isNormal)" mode="subsection" disabled
@change="(e)=>change(e,o,index,i,'isNormal')"
style="width:200px;margin-left: 10px"></u-subsection>
</u-form-item>
<view class="" v-if="o.isNormal">
<u-form-item label="现场图片" prop="inspectPics" borderBottom required>
<u-upload accept="image" :fileList="o.inspectPics" disabled
@afterRead="(e)=>afterRead(e,o,index,i)"
@delete="(e)=>deletePic(e,o,index,i)" name="inspectPics" multiple
:maxCount="10"></u-upload>
</u-form-item>
<u-form-item label="现场视频" prop="inspectVideos" borderBottom>
<u-upload accept="video" :fileList="o.inspectVideos" disabled
@afterRead="(e)=>afterRead(e,o,index,i)"
@delete="(e)=>deletePic(e,o,index,i)" name="inspectVideos" multiple
:maxCount="10"></u-upload>
</u-form-item>
<u-form-item label="问题描述" prop="itemProblemDesc" borderBottom required>
<u--textarea v-model="o.itemProblemDesc" placeholder="请输入内容" disabled></u--textarea>
</u-form-item>
<u-form-item label="处理状态" prop="isHandle" borderBottom required>
<u-subsection :list="listStatus" :current="getHandle(o.isHandle)" disabled
mode="subsection" @change="(e)=>change(e,o,index,i,'isHandle')"
style="width:200px;margin-left: 10px"></u-subsection>
</u-form-item>
<view class="" v-if="o.isHandle !== 0">
<u-form-item label="处理图片" prop="handlePics" borderBottom required>
<u-upload accept="image" :fileList="o.handlePics" disabled
@afterRead="(e)=>afterRead(e,o,index,i)"
@delete="(e)=>deletePic(e,o,index,i)" name="handlePics" multiple
:maxCount="10"></u-upload>
</u-form-item>
<u-form-item label="处理视频" prop="handleVideos" borderBottom>
<u-upload accept="video" :fileList="o.handleVideos" disabled
@afterRead="(e)=>afterRead(e,o,index,i)"
@delete="(e)=>deletePic(e,o,index,i)" name="handleVideos" multiple
:maxCount="10"></u-upload>
</u-form-item>
<u-form-item label="问题描述" prop="handleDesc" borderBottom required>
<u--textarea v-model="o.handleDesc" placeholder="请输入内容" disabled></u--textarea>
</u-form-item>
</view>
<view class="" v-if="o.isHandle == 0">
<u-form-item label="责任人" prop="handleUserId" borderBottom
@click="showSex = true; hideKeyboard()" required>
<u--input v-model="o.handleUserId" disabled disabledColor="#ffffff"
placeholder="请选择性别" border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
</view>
</view>
</u--form>
<u-action-sheet :show="showSex" :actions="actions" title="请选择性别" description="如果选择保密会报错"
@close="showSex = false" @select="sexSelect">
</u-action-sheet> -->
</view>
</view>
</view>
</uni-collapse-item>
</uni-collapse>
</view>
</template>
<script>
export default {
props: {
xjItem: Array
},
data() {
return {
list: ["正常", "异常"],
listStatus: ["已处理", "未处理"],
current: 0,
listData: [],
showSex: false,
actions: [{
name: '男',
},
{
name: '女',
},
{
name: '保密',
},
],
}
},
mounted() {
// this.listData = this.xjItem
},
watch: {
xjItem: function(n, o) {
this.listData = n.map(item => {
item.childen = item.children.map(i => {
i.handlePics?.map(item1=>{
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
return item1
})
i.handleVideos?.map(item1=>{
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
return item1
})
i.inspectPics?.map(item1=>{
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
return item1
})
i.inspectVideos?.map(item1=>{
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
return item1
})
if (!i.handlePics) {
i.handlePics = []
}
if (!i.handleVideos) {
i.handleVideos = []
}
if (!i.inspectPics) {
i.inspectPics = []
}
if (!i.inspectVideos) {
i.inspectVideos = []
}
return i
})
return item
})
console.log(n, this.listData, 'this.listData ');
}
},
methods: {
getIsItem(arr) {
return arr.filter(item1 => item1.isNormal !== 1 && item1.isNormal !== 0).length
},
getNormal(isNormal) {
if (isNormal == 0) {
return 0
}
if (isNormal == 1) {
return 1
}
if (isNormal == null) {
return 3
}
},
getHandle(isHandle) {
if (isHandle == 0) {
return 0
}
if (isHandle == 1) {
return 1
}
if (isHandle == null) {
return 3
}
},
async uploadContent() {
try {
let params = {
status: 2,
list: []
}
this.listData.map(i => {
params.list.push(i.children)
})
const {
data
} = await uni.$http.post(`/gunshiApp/xyt/inspect/task/finish`, params)
} catch (error) {
uni.$showMsg();
}
},
submit() {
let tigger = true
//
this.listData.forEach(item => {
item.ab = item.children.filter(i => {
if (i.isNormal == 1) {
if (i.inspectPics?.length && i.itemProblemDesc) {
tigger = true
} else {
tigger = false
}
if (i.isHandle == 0) {
if (i.handlePics?.length && i.handleDesc) {
tigger = true
} else {
tigger = false
}
} else if (i.isHandle == 1) {
tigger = true
}
} else if (i.isNormal == 0) {
tigger = true
}
})
return item
})
console.log(tigger, 'arr');
if (tigger) {
this.uploadContent()
}
//
// if()
},
//
deletePic(event, o, index, index1) {
this.listData[index].children[index1][event.name].splice(event.index, 1)
},
//
async afterRead(event, o, index, index1) {
console.log(event, index1, this.listData[index]);
// let file
// multiple true , file
let lists = [].concat(event.file)
let fileListLen = this.listData[index].children[index1][event.name]?.length
lists.map((item) => {
this.listData[index].children[index1][event.name].push({
...item,
status: 'uploading',
message: '上传中'
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url, event.name, index, index1)
console.log(result);
let item = this.listData[index].children[index1][event.name][fileListLen]
this.listData[index].children[index1][event.name].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
...result
}))
fileListLen++
}
},
uploadFilePromise(url, name, index, index1) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: 'http://local.gunshiiot.com:18083/gunshiApp/xyt/maintain/service/file/upload/singleSimple', //
filePath: url,
name: 'file',
formData: {
user: 'test'
},
success: (res) => {
setTimeout(() => {
// this.listData[index].children[index1][name].push({...res.data.data,url:res.data.data.filePath})
console.log(res.data)
resolve(JSON.parse(res.data).data)
}, 1000)
}
});
// resolve(a)
})
},
change(e, o, index, i, key) {
this.listData[index].children[i][key] = e;
this.$forceUpdate()
},
sexSelect(e) {
// this.model1.userInfo.sex = e.name
// this.$refs.uForm.validateField('userInfo.sex')
},
}
}
</script>
<style lang="scss" scoped>
.contentItem {
height: 260px;
overflow: auto;
.itemC {
display: flex;
justify-content: space-between;
display: flex;
color: #666666;
padding: 10px;
border-bottom: 1px solid #f0f0f0;
}
.itemNo {
color: #666666;
padding: 10px;
}
}
.circle-btn {
width: 120px;
height: 120px;
background-color: #007aff;
border-radius: 50%;
color: #fff;
text-align: center;
line-height: 120px;
}
.yuandian {
display: inline-block;
width: 10px;
height: 10px;
background-color: #409eff;
border-radius: 50%;
margin-right: 10px;
}
.xj-content {
height: 300px;
overflow-y: auto;
}
.xj-text {
margin-left: 10%;
margin-top: 2%;
font-size: 16px;
border-bottom:1px solid #f0f0f0 ;
}
.subsectioin {
display: flex;
column-gap: 10px;
align-items: center;
margin-top: 10px;
}
</style>

View File

@ -0,0 +1,147 @@
<template>
<view>
<!-- 注意如果需要兼容微信小程序最好通过setRules方法设置rules规则 -->
<u--form labelPosition="left" :model="model1" :rules="rules" ref="uForm">
<u-form-item label="姓名" prop="userInfo.name" borderBottom ref="item1">
<u--input v-model="model1.userInfo.name" border="none"></u--input>
</u-form-item>
<u-form-item label="性别" prop="userInfo.sex" borderBottom @click="showSex = true; hideKeyboard()"
ref="item1">
<u--input v-model="model1.userInfo.sex" disabled disabledColor="#ffffff" placeholder="请选择性别"
border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="内容" prop="userInfo.sex" borderBottom @click="showSex = true; hideKeyboard()"
ref="item1">
<u--textarea v-model="model1.userInfo.namevalue1" placeholder="请输入内容"></u--textarea>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="内容" prop="userInfo.sex" borderBottom @click="showSex = true; hideKeyboard()"
ref="item1">
<u-upload :fileList="fileList" @afterRead="afterRead" @delete="deletePic" name="1" multiple
:maxCount="10"></u-upload>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="内容" prop="userInfo.sex" borderBottom @click="showSex = true; hideKeyboard()"
ref="item1">
<u-upload :fileList="fileList" @afterRead="afterRead" @delete="deletePic" name="1" multiple
:maxCount="10"></u-upload>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
</u--form>
<u-action-sheet :show="showSex" :actions="actions" title="请选择性别" description="如果选择保密会报错"
@close="showSex = false" @select="sexSelect">
</u-action-sheet>
<button @click="submit">11</button>
</view>
</template>
<script>
export default {
data() {
return {
showSex: false,
model1: {
userInfo: {
name: 'uView UI',
sex: '',
},
},
actions: [{
name: '男',
},
{
name: '女',
},
{
name: '保密',
},
],
rules: {
'userInfo.name': {
type: 'string',
required: true,
message: '请填写姓名',
trigger: ['blur', 'change']
},
'userInfo.sex': {
type: 'string',
max: 1,
required: true,
message: '请选择男或女',
trigger: ['blur', 'change']
},
},
radio: '',
switchVal: false
};
},
methods: {
//
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
//
async afterRead(event) {
// multiple true , file
let lists = [].concat(event.file)
let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
status: 'uploading',
message: '上传中'
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
}
},
uploadFilePromise(url,name) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: 'http://local.gunshiiot.com:18083/gunshiApp/xyt/maintain/service/file/upload/singleSimple', //
filePath: url,
name: 'file',
formData: {
user: 'test'
},
success: (res) => {
setTimeout(() => {
// const obj = this.model1[name].find(item=>item.fileId==res.data.data.fileId)
// if(obj){
// }
console.log(JSON.parse(res.data),this.model1,name);
this.model1[name].push({fileId:JSON.parse(res.data).data.fileId})
resolve(res.data.data)
}, 1000)
}
});
})
},
sexSelect(e) {
this.model1.userInfo.sex = e.name
this.$refs.uForm.validateField('userInfo.sex')
},
submit() {
this.$refs.uForm.validate().then(res => {
uni.$u.toast('校验通过')
}).catch(errors => {
uni.$u.toast('校验失败')
})
}
},
onReady() {
//setRules
this.$refs.uForm.setRules(this.rules)
},
};
</script>

View File

@ -0,0 +1,220 @@
<template>
<view :style="{height:'100vh',overflow:'hidden'}">
<u-status-bar></u-status-bar>
<u-navbar :title="taskTitle" :autoBack="true" :titleStyle="{
fontSize:'18px'
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar>
<view class="" style="margin-top: 44px;;background-color: #f0f0f0;border-top: 1px solid #f0f0f0; height:calc(100vh - 44px)">
<view style="margin: 10px;background-color: #fff;padding: 10px;">
<view class="item">
<view class="blueTiao"></view>
<view class="title">
基本信息
</view>
</view>
<view class="contentItem">
<view class="itemC">
<text>任务标题1</text>
<text>{{taskTitle}}</text>
</view>
<view class="itemC">
<text>任务类型11</text>
<text>{{taskType == 1 ? "日常巡查" : taskType == 2 ? "特别检查" : taskType == 3 ? "汛前巡检" : '' }}</text>
</view>
<view class="itemC">
<text>任务内容</text>
<text>{{taskContent ? taskContent : ''}}</text>
</view>
<view class="itemC">
<text>开始日期</text>
<text>{{startDate}}</text>
</view>
<view class="itemC">
<text>结束日期</text>
<text>{{endDate}}</text>
</view>
</view>
</view>
<!-- <view v-show="status == 0 && btnStatus == 0" style="display:flex;justify-content: center;margin-top: 20%;">
<view class="circle-btn" @click="startXc"></view>
</view> -->
<view style="margin: 10px;background-color: #fff;padding: 10px;">
<view class="item">
<view class="blueTiao"></view>
<view class="title">
巡检项
</view>
</view>
<view class="contentItem">
<db-form :xjItem="xjItem"></db-form>
</view>
</view>
</view>
</view>
</template>
<script>
import moment from 'moment'
import DbForm from './dbForm.vue'
export default {
components:{
DbForm
},
data() {
return {
taskTitle:'',
taskType:'',
taskContent:'',
startDate:'',
endDate:'',
status:'',
id:'',
btnStatus: 0,
xjItem:[],
list:["正常","异常"],
current:3
};
},
mounted() {
this.startXc()
},
methods: {
//
async startXc(){
try {
this.btnStatus = 1;
this.getXjItem(this.id)
} catch (error) {
uni.$showMsg();
}
},
//
async getXjItem(id){
try {
const {data} = await uni.$http.get(`/gunshiApp/xyt/inspect/detail/info?taskId=${this.id}`)
if(data.code == 200){
this.xjItem = data.data
}
} catch (error) {
uni.$showMsg();
}
},
change(e){
this.current = e;
}
},
onLoad(option){
this.taskTitle = option.taskTitle
this.taskType = option.taskType
this.taskContent = option.taskContent
this.startDate = (option.startDate)
this.endDate = option.endDate == "null" ? "" : option.endDate
this.status = option.status
this.id = option.id
}
}
</script>
<style lang="scss" scoped>
.myTitleStyle {
font-size: 30px;
background-color: red;
height: 200px;
}
.tabsClass {
margin-top: 44px;
height: 44px;
padding: 0 40px;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
}
.item {
padding-bottom: 10px;
display: flex;
align-items: center;
// justify-content: space-between;
.blueTiao{
background-color: #007aff;
width: 5px;
height: 16px;
margin-right: 10px;
}
.title {
border-width: 0px;
font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑', sans-serif;
font-weight: 700;
font-style: normal;
font-size: 15px;
color: #666666
}
.titleRight {
display: flex;
.border {
border-width: 0px;
background-color: rgba(236, 245, 255, 1);
box-sizing: border-box;
border-width: 1px;
border-style: solid;
border-color: rgba(187, 220, 255, 1);
border-radius: 5px;
box-shadow: none;
width: 58px;
height: 25px;
color: #689FFF;
text-align: center;
}
}
}
.contentItem{
.itemC{
display: flex;
justify-content: space-between;
display: flex;
color: #666666;
padding: 10px;
border-bottom: 1px solid #f0f0f0;
}
.itemNo{
color: #666666;
padding: 10px;
}
}
.circle-btn{
width: 120px;
height: 120px;
background-color: #007aff;
border-radius: 50%;
color:#fff;
text-align: center;
line-height: 120px;
}
.yuandian{
display: inline-block;
width: 10px;
height: 10px;
background-color: #409eff;
border-radius: 50%;
margin-right: 10px;
}
.xj-content{
height: 300px;
overflow-y: auto;
}
.xj-text{
margin-left: 10%;
margin-top: 2%;
}
.subsectioin{
display: flex;
column-gap: 10px;
align-items: center;
margin-top: 10px;
}
</style>

View File

@ -0,0 +1,204 @@
<template>
<view :style="{height:'100vh',overflow:'hidden'}">
<u-status-bar></u-status-bar>
<u-navbar title="巡查任务" :autoBack="true" :titleStyle="{
fontSize:'18px'
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar>
<view style="padding:0 10px; margin-top:50px">
<view class="time-ranger" >
<view class="start-time">
<text>开始时间</text>
<text @click="showTime=true" style="margin-left:15%;color:#3399ef">{{stm}}</text>
</view>
<view class="end-time">
<text>结束时间</text>
<text @click="showTime1=true" style="margin:0 15%;color:#3399ef">{{etm}}</text>
<view class="search-btn" @click="searchHandle">
搜索
</view>
</view>
</view>
<view class="" style="style='overflow: auto;height:calc(100vh - 150px)'">
<view class="" v-for="(item,i) in list" :key="i" style="background-color: #fff;margin-top:10px;">
<view class="item">
<!-- {{item.title}} -->
<view class="title">
{{item.taskTitle}}
</view>
<view class="titleRight" @click="toDetail(item)">
<view class="border">
{{status[item.status]}}
</view>
<u-icon name="arrow-right" size="20"></u-icon>
</view>
</view>
<view class="contentItem">
<view class="itemC">
<text>开始日期</text>
<text>{{item.startDate}}</text>
</view>
<view class="itemC">
<text>结束日期</text>
<text>{{item.endDate}}</text>
</view>
</view>
</view>
</view>
</view>
<u-datetime-picker
:show="showTime"
v-model="startTime"
mode="datetime"
@confirm="handleStartTime"
@cancel="showTime=false"
></u-datetime-picker>
<u-datetime-picker
:show="showTime1"
v-model="endTime"
mode="datetime"
@confirm="handleEndTime"
@cancel="showTime1=false"
></u-datetime-picker>
</view>
</template>
<script>
import moment from 'moment'
const stm = moment().subtract(7, 'months').add(1, 'hour').set({minute: 0, second: 0}).format("YYYY-MM-DD");
const etm = moment().add(1, 'hour').set({minute: 0, second: 0}).format("YYYY-MM-DD");
export default {
data() {
return {
status:{
0:'开始任务',
1:'继续任务',
2:'已完成'
},
startTime:stm,
endTime:etm,
stm,
etm,
showTime:false,
showTime1:false,
list: []
};
},
mounted() {
this.getData()
},
methods: {
searchHandle(){
this.getData()
},
handleStartTime(e){
let time = moment(e.value).format("YYYY-MM-DD HH:mm")
this.stm = time
this.showTime = false
},
handleEndTime(e){
let time = moment(e.value).format("YYYY-MM-DD HH:mm")
this.etm = time;
this.showTime1 = false
},
async getData(){
const userId = uni.getStorageSync('value')?.userId
const params = {
dateRangeSo:{
start:moment(this.stm).format("YYYY-MM-DD"),
end:moment(this.etm).format("YYYY-MM-DD"),
},
inspectUserId:userId,
statusList:[2]
}
try {
const res = await uni.$http.post("/gunshiApp/xyt/inspect/task/list",params)
this.list = [...res.data.data];
} catch (error) {
uni.$showMsg();
}
},
toDetail(record){
uni.navigateTo({
url:`/pages/mypage/compents/xcrw/detail/index?taskTitle=${record.taskTitle}&taskType=${record.taskType}&taskContent=${record.taskContent}&startDate=${record.startDate}&endDate=${record.endDate}&status=${record.status}&id=${record.id}`
})
}
}
}
</script>
<style lang="scss" scoped>
.time-ranger{
margin-bottom: 10px;
.start-time, .end-time{
display: flex;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #dfdfdf;
}
.search-btn{
margin: 3px 0 0 5px;
// color: #3399ef;
}
}
.myTitleStyle {
font-size: 30px;
background-color: red;
height: 200px;
}
.tabsClass {
margin-top: 44px;
height: 44px;
padding: 0 40px;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
}
.item {
border-bottom: 1px solid #f0f0f0;
padding-bottom: 10px;
display: flex;
justify-content: space-between;
.title {
border-width: 0px;
font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑', sans-serif;
font-weight: 700;
font-style: normal;
font-size: 15px;
color: #666666
}
.titleRight {
display: flex;
.border {
border-width: 0px;
background-color: rgba(236, 245, 255, 1);
box-sizing: border-box;
border-width: 1px;
border-style: solid;
border-color: rgba(187, 220, 255, 1);
border-radius: 5px;
box-shadow: none;
width: 75px;
height: 25px;
color: #689FFF;
text-align: center;
}
}
}
.contentItem{
.itemC{
display: flex;
justify-content: space-between;
display: flex;
color: #666666;
padding: 10px;
}
}
</style>

View File

@ -21,6 +21,27 @@
</div>
</div>
</view>
<view class="funcBar xjxList">
<view class="" style="padding: 5px 0 0 5px;">
历史记录
</view>
<view class="" style="display: flex;">
<div class="funcList" v-for="(item, index) in xjxList" :key="index" >
<div @click="navigateToSubPage(index)">
<div class="funcIcon">
<image
class="icon-left"
style="width: 100%; height: 100%"
:src="item.img"
mode="aspectFit"
></image>
</div>
<div class="funcTxt">{{ item.name }}</div>
</div>
</div>
</view>
</view>
<view class="version">
<div class="content">
<div class="left" style="display:flex">
@ -48,6 +69,11 @@
url: '/pages/modifyPassword/modifyPassword'
},
]
const xjxList = [
{img: '../../static/images/info.png', name: '巡查任务', url:'/pages/mypage/compents/xcrw/index'},
{img: '../../static/images/password.png', name: '维修养护', url:'/pages/mypage/compents/wxyh/index'},
{img: '../../static/images/password.png', name: '问题处理', url:'/pages/mypage/compents/wtcl/index'},
]
export default {
data() {
return {
@ -56,14 +82,15 @@
userresponse: '防汛办',
version: '011.14.23',
func: func,
xjxList:xjxList,
default_src: uni.getStorageSync('avatar'),
}
},
methods: {
navigateToSubPage(index) {
uni.navigateTo({
url: func[index].url,
animationType: 'pop-in',
url: xjxList[index].url,
animationType:'pop-in',
})
},
logout() {
@ -225,4 +252,11 @@
color: white;
background-color: #007afd;
}
</style>
.xjxList{
display: flex;
flex-direction: column;
align-items: start;
justify-content: start;
height: 20vh;
}
</style>

View File

@ -1,7 +1,7 @@
<template>
<view :style="{height:'100vh',overflow:'auto'}">
<u-status-bar></u-status-bar>
<u-navbar title="预警" :autoBack="true" :titleStyle="{
<u-navbar title="问题处理" :autoBack="true" :titleStyle="{
fontSize:'18px'
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar>
@ -70,7 +70,7 @@
<u--textarea v-model="queItem.handleDesc" placeholder="请输入内容" ></u--textarea>
</u-form-item>
<u-form-item label="处理图片" prop="handlePics" borderBottom required labelPosition='top'>
<u-upload accept="image" :fileList="queItem.handlePics"
<u-upload accept="image" :fileList="queItem.handlePics || []"
@afterRead="(e)=>afterRead(e,queItem)"
@delete="(e)=>deletePic(e,queItem)" name="handlePics" multiple
:maxCount="10"></u-upload>
@ -128,10 +128,25 @@
console.log(uni.getStorageSync('value'));
this.queItem.handleUserName = uni.getStorageSync('value').userName
this.queItem.handleTime = moment().format('YYYY-MM-DD HH:mm:ss')
},
this.queItem.handleUserId = uni.getStorageSync('value').userId
this.queItem.handlePics.map(item=>{
item.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item.filePath
return item
})
},
methods: {
submit(){
// /inspect/detail/handle
//
if(this.queItem.handlePics?.length < 0 || !this.queItem.handleDesc){
console.log(this.queItem);
uni.$showMsg('请填写处理内容和上传图片');
return;
}else{
console.log(this.queItem);
uni.$http.post('/gunshiApp/xyt/inspect/detail/handle', this.queItem).then(res => {
uni.$showMsg(res.data.description);
})
}
},
//
deletePic(event, o) {
@ -143,7 +158,12 @@
// multiple true , file
console.log(event,'2342132');
let lists = [].concat(event.file)
if(!this.queItem[event.name]){
this.queItem[event.name]=[]
}
let fileListLen = this.queItem[event.name]?.length
console.log(this.queItem[event.name]);
lists.map((item) => {
this.queItem[event.name].push({
...item,
@ -166,7 +186,7 @@
uploadFilePromise(url, name) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: 'http://local.gunshiiot.com:18083/gunshiApp/xyt/maintain/service/file/upload/singleSimple', //
url: 'http://local.gunshiiot.com:18083/gunshiApp/xyt/inspect/task/file/upload/singleSimple', //
filePath: url,
name: 'file',
formData: {

View File

@ -5,8 +5,8 @@
fontSize:'18px'
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar>
<view class="" style="margin-top: 44px;;background-color: #f0f0f0;border-top: 1px solid #f0f0f0;">
<view style="padding:0 10px,backgroundColor:#fff">
<view class="" style="margin-top: 44px;;background-color: #f0f0f0;border-top: 1px solid #f0f0f0;overflow: auto;">
<view style="padding:0 10px;backgroundColor:#fff">
<view class="time-ranger">
<view class="start-time">
<text>开始时间</text>

View File

@ -1,7 +1,6 @@
<template>
<view class="contentItem">
<view class="contentItem" style="height: calc(100% - 350px);">
<uni-collapse>
<uni-collapse-item title-border="none" v-for="(item,index) in listData" :key="index" :border="false"
:show-animation="true">
<template v-slot:title>
@ -15,13 +14,13 @@
<view class="xj-text" v-for="(o,i) in item.children" :key="i">
<text>{{o.itemDesc}}</text>
<view class="subsectioin">
<u--form labelPosition="left" :model="o" ref="uForm">
<u-form-item label="状态" prop="isNormal" borderBottom required>
<u--form labelPosition="left" :model="o" ref="uForm" label-width="100px">
<u-form-item label="状态" prop="isNormal" borderBottom required >
<u-subsection :list="list" :current="getNormal(o.isNormal)" mode="subsection"
@change="(e)=>change(e,o,index,i,'isNormal')"
style="width:200px;margin-left: 10px"></u-subsection>
</u-form-item>
<view class="" v-if="o.isNormal">
<view class="" v-if="o.isNormal==0">
<u-form-item label="现场图片" prop="inspectPics" borderBottom required>
<u-upload accept="image" :fileList="o.inspectPics"
@afterRead="(e)=>afterRead(e,o,index,i)"
@ -42,7 +41,7 @@
mode="subsection" @change="(e)=>change(e,o,index,i,'isHandle')"
style="width:200px;margin-left: 10px"></u-subsection>
</u-form-item>
<view class="" v-if="o.isHandle !== 1">
<view class="" v-if="o.isHandle == 1">
<u-form-item label="现场图片" prop="handlePics" borderBottom required>
<u-upload accept="image" :fileList="o.handlePics"
@afterRead="(e)=>afterRead(e,o,index,i)"
@ -59,30 +58,29 @@
<u--textarea v-model="o.handleDesc" placeholder="请输入内容"></u--textarea>
</u-form-item>
</view>
<view class="" v-if="o.isHandle == 1">
<u-form-item label="责任人" prop="handleUserId" borderBottom
@click="showSex = true; hideKeyboard()" required>
<u--input v-model="o.handleUserId" disabled disabledColor="#ffffff"
placeholder="请选择性别" border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
<view class="" v-if="o.isHandle == 0">
<u-form-item label="责任人" prop="handleUserId" borderBottom required>
<uni-data-picker :localdata="treeList" popup-title="" v-model="o.handleUserId"
:border="false"
:map="{'text':'title','value':'value'}"
></uni-data-picker>
</u-form-item>
</view>
</view>
</u--form>
<u-action-sheet :show="showSex" :actions="actions" title="请选择性别" description="如果选择保密会报错"
@close="showSex = false" @select="sexSelect">
</u-action-sheet>
</view>
</view>
</view>
</uni-collapse-item>
<view class="" style="display: flex;">
<u-button text="保存" customStyle="margin-top: 50px" @click="submit"></u-button>
<u-button type="primary" text="结束巡检" customStyle="margin-top: 50px" @click="submit"></u-button>
</view>
</uni-collapse>
<view class="" style="display: flex;">
<u-button text="保存" customStyle="margin-top: 50px" @click="submit(1)"></u-button>
<u-button type="primary" text="结束巡检" customStyle="margin-top: 50px" @click="submit(2)"></u-button>
</view>
</view>
</template>
@ -94,11 +92,13 @@
},
data() {
return {
list: ["正常", "异常"],
listStatus: ["已处理", "未处理"],
list: ["异常","正常", ],
listStatus: ["未处理","已处理"],
current: 0,
listData: [],
showSex: false,
treeList:[],
deptUserList:[],
actions: [{
name: '男',
},
@ -113,12 +113,31 @@
},
mounted() {
// this.listData = this.xjItem
this.getTreeList()
},
watch: {
xjItem: function(n, o) {
this.listData = n.map(item => {
item.childen = item.children.map(i => {
i.handlePics?.map(item1=>{
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
return item1
})
i.handleVideos?.map(item1=>{
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
return item1
})
i.inspectPics?.map(item1=>{
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
return item1
})
i.inspectVideos?.map(item1=>{
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
return item1
})
if (!i.handlePics) {
i.handlePics = []
}
@ -135,10 +154,59 @@
})
return item
})
console.log(n, this.listData, 'this.listData ');
}
},
methods: {
nodeclick(e){
console.log(e,'1212');
},
buildTree (data, parentId) {
let tree = [];
data.forEach((node) => {
node.title = node.deptName;
node.key = node.deptId;
if (node.parentId === parentId) {
let children = this.buildTree(data, node.deptId);
if (children.length) {
node.children = children;
}
tree.push(node);
}
});
return tree;
},
handleTreeList(dept, user) {
const deptArr = dept.map(item => {
return {
...item,
value: item.deptId,
title: item.deptName,
disabled: item.userId ? false : true,
children: user.filter(u => u.deptId == item.deptId).map(u => ({
...u,
value: String(u.userId),
title: u.nickName
}))
}
})
console.log("deptArr",deptArr);
const treelist = this.buildTree(deptArr,0)
return treelist
},
async getTreeList (){
const res = await uni.$http.get('/gunshiApp/xyt/system/dept/list')
const resUser = await uni.$http.get('/gunshiApp/xyt/system/user/list?pageNum=1&pageSize=9999User')
this.deptUserList = resUser.data.rows
if (res.data.data?.length > 0 && resUser.data.rows?.length > 0) {
// return this.handleTreeList(res.data.data,res.data.rows)
console.log();
this.treeList = this.handleTreeList(res.data.data,resUser.data.rows)
} else {
// return []
this.treeList =[]
}
},
getIsItem(arr) {
return arr.filter(item1 => item1.isNormal !== 1 && item1.isNormal !== 0).length
},
@ -164,44 +232,55 @@
return 3
}
},
async uploadContent() {
async uploadContent(status) {
try {
let params = {
status: 2,
status: status,
list: []
}
this.listData.map(i => {
params.list.push(i.children)
params.list=i.children.map(item=>{ item.handleUserName = this.deptUserList.find(it=>it.userId==item.handleUserId)?.nickName
console.log(this.deptUserList.find(it=>it.userId==item.handleUserId));
return item
})
})
const {
data
} = await uni.$http.post(`/gunshiApp/xyt/inspect/task/finish`, params)
console.log(data,'2121');
if(data.code==200){
uni.$showMsg('提交成功');
uni.navigateTo({
url:'/pages/xcrw/index'
})
}
} catch (error) {
uni.$showMsg();
}
},
submit() {
submit(status) {
let tigger = true
//
this.listData.forEach(item => {
item.ab = item.children.filter(i => {
if (i.isNormal == 1) {
if (i.isNormal == 0) {
if (i.inspectPics?.length && i.itemProblemDesc) {
tigger = true
} else {
tigger = false
uni.$showMsg('请填写现场问题描述和上传现场照片');
}
if (i.isHandle == 0) {
if (i.isHandle == 1) {
if (i.handlePics?.length && i.handleDesc) {
tigger = true
} else {
tigger = false
uni.$showMsg('请填写处理问题描述和上传处理照片');
}
} else if (i.isHandle == 1) {
} else if (i.isHandle == 0) {
tigger = true
}
} else if (i.isNormal == 0) {
} else if (i.isNormal == 1) {
tigger = true
}
})
@ -209,7 +288,9 @@
})
console.log(tigger, 'arr');
if (tigger) {
this.uploadContent()
this.uploadContent(status)
}else{
}
//
// if()
@ -247,7 +328,7 @@
uploadFilePromise(url, name, index, index1) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: 'http://local.gunshiiot.com:18083/gunshiApp/xyt/maintain/service/file/upload/singleSimple', //
url: 'http://local.gunshiiot.com:18083/gunshiApp/xyt/inspect/task/file/upload/singleSimple', //
filePath: url,
name: 'file',
formData: {
@ -273,14 +354,15 @@
// this.model1.userInfo.sex = e.name
// this.$refs.uForm.validateField('userInfo.sex')
},
}
}
</script>
<style lang="scss" scoped>
.contentItem {
height: 260px;
overflow: auto;
// height: 260px;
// overflow: auto;
.itemC {
display: flex;

View File

@ -1,5 +1,5 @@
<template>
<view :style="{height:'100vh',overflow:'hidden'}">
<view :style="{height:'100vh'}">
<u-status-bar></u-status-bar>
<u-navbar :title="taskTitle" :autoBack="true" :titleStyle="{
fontSize:'18px'
@ -37,9 +37,12 @@
</view>
</view>
<view v-show="status == 0 && btnStatus == 0" style="display:flex;justify-content: center;margin-top: 20%;">
<view class="circle-btn" @click="startXc"></view>
<view v-show="status !== 2 && btnStatus == 0" style="display:flex;justify-content: center;margin-top: 20%;">
<view v-show="status !== 2 && btnStatus == 0" class="circle-btn" @click="startXc">{{statusType[status]}}</view>
</view>
<view class="" style="height: calc(100vh - 311px);overflow: auto;">
<view v-show="btnStatus != 0" style="margin: 10px;background-color: #fff;padding: 10px;">
<view class="item">
<view class="blueTiao"></view>
@ -47,10 +50,11 @@
巡检项
</view>
</view>
<view class="contentItem">
<view class="contentItem1" style="height: 100%;">
<db-form :xjItem="xjItem"></db-form>
</view>
</view>
</view>
</view>
</view>
</template>
@ -74,19 +78,30 @@
btnStatus: 0,
xjItem:[],
list:["正常","异常"],
current:3
current:3,
statusType:{
0:'开始巡查',
1:'继续巡查',
2:'已完成'
},
};
},
methods: {
//
async startXc(){
try {
// const {data} = await uni.$http.get(`/gunshiApp/xyt/inspect/task/startInspect/${this.id}`)
// if(data.code == 200){
// this.btnStatus = 1;
// }
this.btnStatus = 1;
this.getXjItem(this.id)
if(status == 0){
const {data} = await uni.$http.get(`/gunshiApp/xyt/inspect/task/startInspect/${this.id}`)
if(data.code == 200){
this.btnStatus = 1;
this.getXjItem(this.id)
}
}else if(status == 1){
this.btnStatus = 1;
this.getXjItem(this.id)
}
} catch (error) {
uni.$showMsg();
}
@ -102,16 +117,15 @@
uni.$showMsg();
}
},
change(e){
this.current = e;
}
},
onLoad(option){
this.taskTitle = option.taskTitle
this.taskType = JSON.parse(option.taskType)
this.taskContent = JSON.parse(option.taskContent)
this.taskType = option.taskType
this.taskContent = option.taskContent
this.startDate = (option.startDate)
this.endDate = option.endDate == "null" ? "" : option.endDate
this.status = option.status
this.id = option.id
}
@ -132,7 +146,15 @@
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
}
.circle-btn{
width: 120px;
height: 120px;
background-color: #007aff;
border-radius: 50%;
color:#fff;
text-align: center;
line-height: 120px;
}
.item {
padding-bottom: 10px;
@ -187,35 +209,4 @@
padding: 10px;
}
}
.circle-btn{
width: 120px;
height: 120px;
background-color: #007aff;
border-radius: 50%;
color:#fff;
text-align: center;
line-height: 120px;
}
.yuandian{
display: inline-block;
width: 10px;
height: 10px;
background-color: #409eff;
border-radius: 50%;
margin-right: 10px;
}
.xj-content{
height: 300px;
overflow-y: auto;
}
.xj-text{
margin-left: 10%;
margin-top: 2%;
}
.subsectioin{
display: flex;
column-gap: 10px;
align-items: center;
margin-top: 10px;
}
</style>

View File

@ -1,7 +1,7 @@
<template>
<view :style="{height:'100vh',overflow:'hidden'}">
<u-status-bar></u-status-bar>
<u-navbar title="巡查任务" :autoBack="true" :titleStyle="{
<u-navbar title="巡查任务1" :autoBack="true" :titleStyle="{
fontSize:'18px'
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar>
@ -19,7 +19,10 @@
</view>
</view>
</view>
</view >
<view class="" style='overflow: auto;height:calc(100vh - 150px)'>
<view class="" v-for="(item,i) in list" :key="i" style="background-color: #fff;margin-top:10px;">
<view class="item">
<!-- {{item.title}} -->
@ -28,7 +31,7 @@
</view>
<view class="titleRight" @click="toDetail(item)">
<view class="border">
{{item.status == 1 ? "继续任务": "开始任务" }}
{{status[item.status]}}
</view>
<u-icon name="arrow-right" size="20"></u-icon>
</view>
@ -44,6 +47,7 @@
</view>
</view>
</view>
</view>
</view>
<u-datetime-picker
@ -70,6 +74,11 @@
export default {
data() {
return {
status:{
0:'开始任务',
1:'继续任务',
// 2:''
},
startTime:stm,
endTime:etm,
stm,
@ -115,6 +124,7 @@
}
},
toDetail(record){
console.log(record);
uni.navigateTo({
url:`/pages/xcrw/detail/index?taskTitle=${record.taskTitle}&taskType=${record.taskType}&taskContent=${record.taskContent}&startDate=${record.startDate}&endDate=${record.endDate}&status=${record.status}&id=${record.id}`
})

View File

@ -9,8 +9,8 @@
</view>
</view>
<view class="content">
<view class="listItem" v-for="(v,k) of list" :style="{border:'1px solid red'}">
<view class="top" style="background-color: red;border-bottom: 1px solid red;">
<view class="listItem" v-for="(v,k) of list" :style="{border:`1px solid ${getColor(item[k])}`}">
<view class="top" :style="'background-color:'+getColor(item[k])+';border-bottom: 1px solid '+getColor(item[k])+';'">
{{k}}
</view>
<view class="bottom">
@ -43,7 +43,23 @@
}
},
methods:{
getColor(v){
if(v>=0 && v<10){
return '#bdef9a'
}
if(v>=10 && v<25){ return '#bdef9a'}
if(v>=20 && v<50){return '#6ec1fb'}
if(v>=50 && v<100){return '#1d1bc7'}
if(v>=100 && v<250){return '#eb20f5'}
if(v>=250){return '#761e50'}
// #bdef9a 0-10,
// #bdef9a 10-25
// #6ec1fb 20-50
// #1d1bc7 50-100
// #eb20f5 100-250
// #761e50 >=250
},
//
async getYlzData(){
try {