Compare commits

..

No commits in common. "17e72d0bd10e3f47c139e030089287e86c81d9dc" and "6aa24fae37684d60e02f4e865ef971b6bdcc6948" have entirely different histories.

8 changed files with 229 additions and 104 deletions

View File

@ -71,12 +71,14 @@
</u-form-item>
<u-form-item label="处理图片" prop="handlePics" borderBottom required labelPosition='top'>
<u-upload accept="image" :fileList="queItem.handlePics || []" disabled
name="handlePics" multiple
@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
name="handleVideos" multiple
@afterRead="(e)=>afterRead(e,queItem)"
@delete="(e)=>deletePic(e,queItem)" name="handleVideos" multiple
:maxCount="10"></u-upload>
</u-form-item>
</view>
@ -109,32 +111,86 @@
},
onLoad(options) {
this.queItem = JSON.parse(options.item)
this.queItem.handleVideos?.map(item1=>{
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
return item1
})
this.queItem.handlePics?.map(item1=>{
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
return item1
})
console.log(this.queItem);
},
methods: {
previewImage(item){
uni.previewImage({
urls: [item.url],
longPressActions: {
itemList: ['发送给朋友', '保存图片', '收藏'],
success: function(data) {
console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
},
fail: function(err) {
console.log(err.errMsg);
}
}
});
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>

View File

@ -14,48 +14,46 @@
<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.isNormal == 0?o.isHandle?'已处理':'未处理':''}})</text>
<!-- <text></text> -->
<text>{{o.isNormal == 0?'异常':'正常'}}{{o.isHandle?'已处理':'未处理'}}</text>
</view>
<view class="" v-if="o.isNormal == 0">
<view class="itemEve">
<text>现场图片:</text>
<view style="">
<text>现场图片</text>
<view class="" v-for="item in o.inspectPics">
<image :src="item.url" style="width: 80px;height: 80px;margin: 5px;" @click="previewImage(item)"></image>
<image :src="item.url" style="width: 80px;height: 80px;margin: 5px;" ></image>
</view>
</view>
<view v-if="o.inspectVideos.length" class="itemEve">
<text>现场视频:</text>
<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;" class="itemEve">
<text>问题描述:</text>
<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="" class="itemEve">
<text>处理图片:</text>
<view style="">
<text>处理图片</text>
<view class="" v-for="item in o.handlePics">
<image :src="item.url" style="width: 80px;height: 80px;margin: 5px;" @click="previewImage(item)"></image>
<image :src="item.url" style="width: 80px;height: 80px;margin: 5px;"></image>
</view>
</view>
<view style="" v-if="o.handleVideos.length" class="itemEve">
<text>处理视频:</text>
<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;" class="itemEve">
<text>问题描述:</text <text>{{o.handleDesc}}</text>
<view style="display: flex;justify-content: space-between;">
<text>问题描述</text <text>{{o.handleDesc}}</text>
</view>
</view>
<view style="display: flex;" v-if="o.isHandle == 0" class="itemEve">
<view style="display: flex;justify-content: space-between;" v-if="o.isHandle == 0">
<text>责任人</text>
<text>{{o.handleUserName}}</text>
</view>
@ -198,20 +196,6 @@
}
},
methods: {
previewImage(item){
uni.previewImage({
urls: [item.url],
longPressActions: {
itemList: ['发送给朋友', '保存图片', '收藏'],
success: function(data) {
console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
},
fail: function(err) {
console.log(err.errMsg);
}
}
});
},
getIsItem(arr) {
return arr.filter(item1 => item1.isNormal !== 1 && item1.isNormal !== 0).length
},
@ -237,6 +221,115 @@
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>
@ -298,7 +391,4 @@
align-items: center;
margin-top: 10px;
}
.itemEve{
margin: 10px 0;
}
</style>

View File

@ -12,7 +12,7 @@
</view>
<view class="funcBar">
<div class="funcList" v-for="(item, index) in func" :key="index">
<div @click="navigateToSubPage(func,index)">
<div @click="navigateToSubPage(index)">
<div class="funcIcon">
<image class="icon-left" style="width: 100%; height: 100%" :src="item.img" mode="aspectFit">
</image>
@ -28,7 +28,7 @@
<view class="" style="display: flex;">
<div class="funcList" v-for="(item, index) in xjxList" :key="index" >
<div @click="navigateToSubPage(xjxList,index)">
<div @click="navigateToSubPage(index)">
<div class="funcIcon" style="width:30px:;height:30px">
<image
class="icon-left"
@ -87,9 +87,9 @@
}
},
methods: {
navigateToSubPage(item,index) {
navigateToSubPage(index) {
uni.navigateTo({
url: item[index].url,
url: xjxList[index].url,
animationType:'pop-in',
})
},

View File

@ -2,8 +2,8 @@
<view class="skinfo" @click="toDetail()">
<view class="title">
<view class="left">
<u-icon name="file-text" color="origin"></u-icon>
<text>{{dataform.resName}}</text>
<u-icon name="file-text" color="#f59d29" size="20"></u-icon>
<text style="margin-left:5px">{{dataform.resName}}</text>
</view>
<view class="right">
{{tm}}
@ -13,7 +13,7 @@
<view class="" style="display: flex;">
<image src="../../static/c1.png" mode="" style="width:30%;height: 120px;"></image>
<view class="listItem">
<view class="item-text" v-for="(v,k) of list">
<view class="item-text" v-for="(v,k) of list" :key="k">
<text>{{v}}</text>:
<text>{{dataform[k]}}</text>
</view>
@ -42,16 +42,16 @@
data(){
return{
list:{
'drp':'当前水位m',
2:'今日雨量mm',
"rz":'当前水位m',
"today":'今日雨量mm',
'flLowLimLev':'汛限水位m',
4:'比汛期m',
"demo":'比汛期m',
'wcrstel':'堰顶高程m',
'crestElev':'坝顶高程m',
7:'24h预报',
8:'昨日雨量',
"24h":'24h预报mm',
"yesterdayDrp":'昨日雨量mm',
'totCap':'总库容m³',
10:'蓄水量万m³'
"cap":'蓄水量万m³'
},
tm: moment().format('YYYY-MM-DD HH:mm:ss'),
dataform:{
@ -97,15 +97,13 @@
justify-content: space-between;
align-items: center;
.left{
align-items: center;
font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑', sans-serif;
font-weight: 700;
font-style: normal;
font-size: 16px;
display: flex;
}
.right{
}
}
.content{

View File

@ -126,7 +126,7 @@
onLoad(options) {
this.queItem = JSON.parse(options.item)
console.log(uni.getStorageSync('value'));
this.queItem.handleUserName = uni.getStorageSync('value').nickName
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=>{
@ -145,11 +145,6 @@
console.log(this.queItem);
uni.$http.post('/gunshiApp/xyt/inspect/detail/handle', this.queItem).then(res => {
uni.$showMsg(res.data.description);
if(res.data.code == 200){
uni.redirectTo({
url:'/pages/wtcl/index'
})
}
})
}
},

View File

@ -18,7 +18,7 @@ export default {
data() {
return {
formData: {
reportUserName:uni.getStorageSync('value').nickName,
reportUserName:uni.getStorageSync('value').userName,
reportTime:moment().format('YYYY-MM-DD HH:mm:ss'),
userId:uni.getStorageSync('value').userId
},
@ -27,7 +27,7 @@ export default {
onShow() {
const userList=uni.getStorageSync('value')
console.log(userList,'3456789045678945678');
this.formData.reportUserName = uni.getStorageSync('value').nickName
this.formData.reportUserName = uni.getStorageSync('value').userName
this.formData.userId = uni.getStorageSync('value').userId
},
};

View File

@ -53,9 +53,7 @@ export default {
uni.$http.post('/gunshiApp/xyt/maintain/service/insert',{...params,...this.formData}).then(res=>{
if(res.data.code == 200){
uni.$u.toast('新增成功')
uni.switchTab({
url: '/pages/homeIndex/index'
});
uni.navigateBack()
}
})
},

View File

@ -14,11 +14,11 @@
<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" label-width="80px">
<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:150px"></u-subsection>
style="width:200px;margin-left: 10px"></u-subsection>
</u-form-item>
<view class="" v-if="o.isNormal==0">
<u-form-item label="现场图片" prop="inspectPics" borderBottom required>
@ -39,7 +39,7 @@
<u-form-item label="处理状态" prop="isHandle" borderBottom required>
<u-subsection :list="listStatus" :current="getHandle(o.isHandle)"
mode="subsection" @change="(e)=>change(e,o,index,i,'isHandle')"
style="width:150px"></u-subsection>
style="width:200px;margin-left: 10px"></u-subsection>
</u-form-item>
<view class="" v-if="o.isHandle == 1">
<u-form-item label="现场图片" prop="handlePics" borderBottom required>
@ -63,18 +63,7 @@
<uni-data-picker :localdata="treeList" popup-title="" v-model="o.handleUserId"
:border="false"
:map="{'text':'title','value':'value'}"
v-slot:default="{data, error, options}"
>
<view v-if="error" class="error">
<text>{{error}}</text>
</view>
<view v-else-if="data.length" class="selected">
<text>{{data[data.length-1].text}}</text>
</view>
<view v-else>
<text>请选择</text>
</view>
</uni-data-picker>
></uni-data-picker>
</u-form-item>
</view>
@ -207,7 +196,7 @@
},
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=9999')
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)
@ -261,7 +250,7 @@
console.log(data,'2121');
if(data.code==200){
uni.$showMsg('提交成功');
uni.redirectTo({
uni.navigateTo({
url:'/pages/xcrw/index'
})
}
@ -416,7 +405,6 @@
.xj-text {
margin-left: 10%;
margin-right: 10%;
margin-top: 2%;
}