lion 3 years ago
parent e8b12fd6bc
commit b1a42ed8fb

@ -189,7 +189,7 @@
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding: 20rpx 28rpx;
padding: 6rpx 28rpx;
box-sizing: border-box;
position: relative;

@ -70,11 +70,27 @@
<u-col span="3">
照片
</u-col>
<u-col span="9" v-for="(img,index) in dealFilesList">
<u-image @click="imgListPreview(img.files.url)" style="margin:20rpx 0" width="100%" height="300rpx"
:src="img.files.url"></u-image>
<u-col span="9">
<htz-image-upload v-model="askImgs" :max="9" :remove="false" :add="false"></htz-image-upload>
</u-col>
</u-row>
</u-row>
<u-row gutter="16" v-if="askVideos.length>0">
<u-col span="3">
视频
</u-col>
<u-col span="9">
<htz-image-upload v-model="askVideos" :max="9" :remove="false" :add="false"></htz-image-upload>
</u-col>
</u-row>
<u-row gutter="16" v-if="askAudios.length>0">
<u-col span="3">
音频
</u-col>
<u-col span="9">
<htz-image-upload v-model="askAudios" :max="9" :remove="false" :add="false"></htz-image-upload>
</u-col>
</u-row>
</div>
<div class="deal info">
<u-row gutter="16">
@ -100,14 +116,30 @@
<u-col span="9">
{{item.deal_content}}
</u-col>
</u-row>
<u-row gutter="16">
<u-col span="3">
处理照片
</u-col>
<u-col span="9">
</u-col>
</u-row>
<u-row gutter="16">
<u-col span="3">
处理照片
</u-col>
<u-col span="9">
<htz-image-upload v-model="dealImgs" :max="9" :remove="false" :add="false"></htz-image-upload>
</u-col>
</u-row>
<u-row gutter="16" v-if="dealVideos.length>0">
<u-col span="3">
处理视频
</u-col>
<u-col span="9">
<htz-image-upload v-model="dealVideos" :max="9" :remove="false" :add="false"></htz-image-upload>
</u-col>
</u-row>
<u-row gutter="16" v-if="dealAudios.length>0">
<u-col span="3">
处理音频
</u-col>
<u-col span="9">
<htz-image-upload v-model="dealAudios" :max="9" :remove="false" :add="false"></htz-image-upload>
</u-col>
</u-row>
</div>
<div class="info line">
@ -139,7 +171,13 @@
data() {
return {
item: {},
dealFilesList: []
dealFilesList: [],
askImgs:[],
askVideos:[],
askAudios:[],
dealImgs:[],
dealVideos:[],
dealAudios:[]
}
},
onReady() {
@ -161,22 +199,40 @@
id: id
},
utilSuccess: function(res) {
that.item = res
that.item = res
// console.log(that.fileListObj)
// for(var m in that.fileListObj){
// console.log("m",m,res[m])
// for(var k of res[m]){
// console.log("k",k)
// that.fileListObj[m]['arr'].push(k.uploads[0].url)
// }
// }
// console.log(that.fileListObj)
for(var m of res.ask_images){
that.askImgs.push(m.uploads[0].url)
}
for(var m of res.ask_videos){
that.askVideos.push(m.uploads[0].url)
}
for(var m of res.ask_voice){
that.askAudios.push(m.uploads[0].url)
}
for(var m of res.deal_images){
that.dealImgs.push(m.uploads[0].url)
}
for(var m of res.deal_videos){
that.dealVideos.push(m.uploads[0].url)
}
for(var m of res.deal_voice){
that.dealAudios.push(m.uploads[0].url)
}
},
utilFail: function(res) {
that.util.alert(res);
}
});
},
imgListPreview(item) {
var urlList = []
urlList.push(item) //push :src="item.img_url"
uni.previewImage({
indicator: "number",
loop: true,
urls: urlList
})
},
}
}
}
</script>

@ -71,7 +71,7 @@
:action="action"></htz-image-upload>
</u-form-item>
<u-form-item label="备注" prop="ask_content">
<u-input type="textarea" placeholder="请输入备注" label-position="top" v-model="form.ask_content" />
<u-input type="textarea" :border="border" placeholder="请输入备注" label-position="top" v-model="form.ask_content" />
</u-form-item>
</u-form>
<u-button type="primary" @click="submit"></u-button>
@ -257,43 +257,56 @@
},
//
onprogress(res) {
// uni.showToast({
// icon: "none",
// title: "",
// duration: 2000
// })
uni.showLoading({
title: '上传中'
});
},
tosuccess() {
// uni.showToast({
// icon: "none",
// title: "",
// duration: 2000
// })
uploadSuccess(res,type){
console.log(type)
uni.showLoading({
title: '上传成功'
});
},
toremove(index, lists, name, whatfile) {
if (whatfile == "picFileList") {
this.picFileList.splice(index, 1)
title:"上传成功"
})
let obj = {}
let data = JSON.parse(res.data)
obj.id = data.id
obj.url = data.url
if(type=="pic"){
obj.type=0
}else{
obj.type=1
}
if (whatfile == "dealFilesList") {
this.dealFilesList.splice(index, 1)
switch (type){
case 'video':
this.videoFileList.push(obj)
break;
case 'audio':
this.audioFileList.push(obj)
break;
case 'pic':
this.picFileList.push(obj)
break;
default:
break;
}
},
toupload(lists, name, whatfile) {
var that = this;
if (whatfile == "picFileList") {
that.picFileList = lists
}
if (whatfile == "dealFilesList") {
that.dealFilesList = lists;
imgDelete(res,type){
console.log("imgDelete",res)
let list = []
list = res.tempFilePaths
switch (type){
case 'video':
this.videoFileList = list
break;
case 'audio':
this.audioFileList= list
break;
case 'pic':
this.picFileList= list
break;
default:
break;
}
},
uploadFail(res){
console.log("uploadFail",res)
},
submit(){
var that = this;
let pic = []
@ -314,7 +327,7 @@
for(var m in fileListObj){
for(var k of fileListObj[m]['arr']){
pic.push({
id:k.id,
upload_id:k.id,
type:fileListObj[m]['type']
})
}
@ -351,50 +364,7 @@
url: "../inspect/list"
})
},
uploadSuccess(res,type){
console.log(type)
uni.showLoading({
title:"上传成功"
})
let obj = {}
let data = JSON.parse(res.data)
obj.id = data.id
obj.url = data.url
switch (type){
case 'video':
this.videoFileList.push(obj)
break;
case 'audio':
this.audioFileList.push(obj)
break;
case 'pic':
this.picFileList.push(obj)
break;
default:
break;
}
},
imgDelete(res,type){
console.log("imgDelete",res)
let list = []
list = res.tempFilePaths
switch (type){
case 'video':
this.videoFileList = list
break;
case 'audio':
this.audioFileList= list
break;
case 'pic':
this.picFileList= list
break;
default:
break;
}
},
uploadFail(res){
console.log("uploadFail",res)
}
}
}

@ -1,7 +1,7 @@
<template>
<div>
<u-empty v-if="isEmpty" text="暂时没有数据" mode="list"></u-empty>
<load-refresh ref="loadRefresh" :isRefresh="true" refreshType="hollowDots" color="#04C4C4" heightReduce="0"
<u-empty v-if="isEmpty"style="height:100vh" text="暂时没有数据" mode="list"></u-empty>
<load-refresh v-else ref="loadRefresh" :isRefresh="true" refreshType="hollowDots" color="#04C4C4" heightReduce="0"
backgroundCover="#F3F5F5" :currentPage="pages.page" :totalPages="pages.total" @loadMore="loadMore"
@refresh="runRefresh">
<view slot="content-list">
@ -61,11 +61,12 @@
method: "get",
data: {
page: that.pages.page,
page_size: that.pages.page_size
page_size: that.pages.page_size,
myself:1
},
utilSuccess: function(res) {
console.log(res)
if (res.last_page == 0) {
if (res.total == 0) {
that.isEmpty = true
return
}

@ -38,6 +38,11 @@
"style": {
"navigationBarTitleText": "问题处理"
}
},{
"path": "solve/solve",
"style": {
"navigationBarTitleText": "问题处理"
}
}
],
"globalStyle": {

@ -1,8 +1,167 @@
<template>
</template>
<script>
</script>
<style>
</style>
<template>
<div>
<u-empty v-if="isEmpty" style="height:100vh" text="暂时没有数据" mode="list"></u-empty>
<load-refresh v-else ref="loadRefresh" :isRefresh="true" refreshType="hollowDots" color="#04C4C4" heightReduce="0"
backgroundCover="#F3F5F5" :currentPage="pages.page" :totalPages="pages.total" @loadMore="loadMore"
@refresh="runRefresh">
<view slot="content-list">
<!-- 数据列表 -->
<view v-for="(item,index) in list" :key="index" class="listwrap">
<u-row gutter="16" @click="toInfo(item.id)">
<u-col span="1.5">
<view class="listindex">
{{index+1}}
</view>
</u-col>
<u-col span="8" class="listcontent">
<view><span>区域</span>{{item.area_detail?item.area_detail.value:''}}</view>
<view><span>河道</span>{{item.river?item.river.name:''}}</view>
<view><span>地址</span>{{item.address}}</view>
<view><span>问题类型</span>{{item.ask_type?item.ask_type.name:''}}</view>
<view><span>问题状态</span>{{item.ask_status_text}}</view>
<view><span>上报时间</span>{{item.created_at}}</view>
</u-col>
<u-col span="2.5">
<view class="listbutton">处理</view>
</u-col>
</u-row>
</view>
</view>
</load-refresh>
</div>
</template>
<script>
import loadRefresh from '@/components/load-refresh/load-refresh.vue'
export default {
data() {
return {
pages: {
page: 1,
page_size: 5,
total: 0
},
list: [],
isEmpty: false
}
},
onReady() {
},
onLoad() {
this.loadList()
},
methods: {
loadList() {
var that = this;
that.util.request({
api: '/api/mobile/inspection/index',
method: "get",
data: {
page: that.pages.page,
page_size: that.pages.page_size,
deal_user_id:1,
// ask_status:3
// ask_type_id:19
},
utilSuccess: function(res) {
console.log(res)
if (res.total == 0) {
that.isEmpty = true
return
}
that.pages.total = res.last_page
if (that.pages.page > 1) {
that.list.push(...res.data)
} else {
that.list = res.data
}
console.log(that.pages)
that.$refs.loadRefresh.completed()
// that.areaList = result.detail
},
utilFail: function(res) {
that.util.alert(res);
}
});
},
//
loadMore() {
var that = this
setTimeout(() => {
that.pages.page = that.pages.page + 1
that.loadList()
}, 400)
},
//
refresh() {
var that = this
console.log(that.pages.page)
//
setTimeout(() => {
that.pages.page = 1
that.loadList();
}, 400)
},
// loadMore()refresh()list
//
runRefresh() {
this.$refs.loadRefresh.runRefresh()
},
toInfo(id) {
uni.redirectTo({
url: "../solve/solve?id=" + id
})
}
}
}
</script>
<style scoped>
.listwrap {
margin: 25rpx;
background: #fff;
border-radius: 30rpx;
padding: 20rpx;
}
.listindex {
width: 60rpx;
height: 60rpx;
background-color: deepskyblue;
border-radius: 60rpx;
color: #fff;
line-height: 60rpx;
text-align: center;
}
.listcontent {}
.listcontent view {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.listcontent view span {
display: inline-block;
width: 31%;
text-align: right;
}
.listbutton {
width: 100%;
background-color: deepskyblue;
text-align: center;
color: #fff;
height: 60rpx;
border-radius: 30rpx;
line-height: 60rpx;
}
</style>

@ -0,0 +1,368 @@
<template>
<div class="wrap">
<div class="map"></div>
<div class="info">
<u-row gutter="16">
<u-col span="3">
区域
</u-col>
<u-col span="9">
{{item.area_detail?item.area_detail.value:''}}
</u-col>
</u-row>
<u-row gutter="16">
<u-col span="3">
河道
</u-col>
<u-col span="9">
{{item.river?item.river.name:''}}
</u-col>
</u-row>
<u-row gutter="16">
<u-col span="3">
问题类型
</u-col>
<u-col span="9">
{{item.ask_type?item.ask_type.name:''}}
</u-col>
</u-row>
<u-row gutter="16">
<u-col span="3">
上报时间
</u-col>
<u-col span="9">
{{item.created_at}}
</u-col>
</u-row>
<u-row gutter="16">
<u-col span="3">
地址
</u-col>
<u-col span="9">
{{item.address}}
</u-col>
</u-row>
<u-row gutter="16">
<u-col span="3">
上报人
</u-col>
<u-col span="9">
{{item.user?item.user.name:''}}
</u-col>
</u-row>
<u-row gutter="16">
<u-col span="3">
问题描述
</u-col>
<u-col span="9">
{{item.ask_content}}
</u-col>
</u-row>
<u-row gutter="16">
<u-col span="3">
驳回原因
</u-col>
<u-col span="9">
</u-col>
</u-row>
<u-row gutter="16">
<u-col span="3">
照片
</u-col>
<u-col span="9">
<htz-image-upload v-model="askImgs" :max="9" :remove="false" :add="false"></htz-image-upload>
</u-col>
</u-row>
<u-row gutter="16" v-if="askVideos.length>0">
<u-col span="3">
视频
</u-col>
<u-col span="9">
<htz-image-upload v-model="askVideos" :max="9" :remove="false" :add="false"></htz-image-upload>
</u-col>
</u-row>
<u-row gutter="16" v-if="askAudios.length>0">
<u-col span="3">
音频
</u-col>
<u-col span="9">
<htz-image-upload v-model="askAudios" :max="9" :remove="false" :add="false"></htz-image-upload>
</u-col>
</u-row>
</div>
<div class="info">
<u-form :model="form" ref="uForm" :label-width='120'>
<u-form-item label="处理情况" prop="deal_content">
<u-input type="textarea" :border="true" placeholder="请输入处理情况" label-position="top"
v-model="form.deal_content" />
</u-form-item>
<u-form-item label="问题影像" prop="picFileList">
<htz-image-upload :max="9" v-model="picFileList" mediaType="image" :chooseNum="9"
:sourceType="['album','camera']" :compress="false" :quality="80" :formData="otherData"
:remove="true" :dataType="1" @uploadSuccess="function(res) { return uploadSuccess(res,'pic')}"
@imgDelete="function(res) { return imgDelete(res,'pic')}" @uploadFail="uploadFail"
:action="action"></htz-image-upload>
</u-form-item>
<u-form-item label="问题视频" prop="videoFileList">
<htz-image-upload :max="9" v-model="videoFileList" mediaType="video" :chooseNum="9"
:sourceType="['album','camera']" :compress="false" :quality="80" :formData="otherData"
:remove="true" :dataType="1" @uploadSuccess="function(res) { return uploadSuccess(res,'video')}"
@imgDelete="function(res) { return imgDelete(res,'video')}" @uploadFail="uploadFail"
:action="action"></htz-image-upload>
</u-form-item>
<u-form-item label="问题语音" prop="audioFileList">
<htz-image-upload :max="9" v-model="audioFileList" mediaType="video" :chooseNum="9"
:sourceType="['album','camera']" :compress="false" :quality="80" :formData="otherData"
:remove="true" :dataType="1" @uploadSuccess="function(res) { return uploadSuccess(res,'audio')}"
@imgDelete="function(res) { return imgDelete(res,'audio')}" @uploadFail="uploadFail"
:action="action"></htz-image-upload>
</u-form-item>
</u-form>
<view class="btns">
<u-button type="info" @click="isBack=true">退</u-button>
<u-button type="primary" @click="submit"></u-button>
</view>
<u-modal v-model="isBack" @confirm="sendback"
content="是否确认退回?"
:show-cancel-button="true"
:mask-close-able="true"
:show-title="false"></u-modal>
</div>
</div>
</template>
<script>
export default {
data() {
return {
item: {},
dealFilesList: [],
askImgs: [],
askVideos: [],
askAudios: [],
action: "",
otherData: {
token: ""
},
picFileList: [],
videoFileList: [], // url
audioFileList: [],
form: {
deal_content: "",
inspection_file_list: [],
ask_status: 1
},
isBack:false
}
},
onReady() {
},
onLoad(options) {
this.action = this.util.HOST + "/api/mobile/upload-file";
this.otherData.token = uni.getStorageSync("userInfo_token").access_token;
if (options.id) {
this.loadInfo(options.id)
}
},
methods: {
loadInfo(id) {
var that = this;
that.util.request({
api: '/api/mobile/inspection/show',
method: "get",
data: {
id: id
},
utilSuccess: function(res) {
that.item = res
that.form = res
console.log(that.form)
for (var m of res.ask_images) {
that.askImgs.push(m.uploads[0].url)
}
for (var m of res.ask_videos) {
that.askVideos.push(m.uploads[0].url)
}
for (var m of res.ask_voice) {
that.askAudios.push(m.uploads[0].url)
}
},
utilFail: function(res) {
that.util.alert(res);
}
});
},
//
uploadSuccess(res, type) {
console.log(type)
uni.showLoading({
title: "上传成功"
})
let obj = {}
let data = JSON.parse(res.data)
obj.id = data.id
obj.url = data.url
if (type == "pic") {
obj.type = 0
} else {
obj.type = 1
}
switch (type) {
case 'video':
this.videoFileList.push(obj)
break;
case 'audio':
this.audioFileList.push(obj)
break;
case 'pic':
this.picFileList.push(obj)
break;
default:
break;
}
},
imgDelete(res, type) {
console.log("imgDelete", res)
let list = []
list = res.tempFilePaths
switch (type) {
case 'video':
this.videoFileList = list
break;
case 'audio':
this.audioFileList = list
break;
case 'pic':
this.picFileList = list
break;
default:
break;
}
},
uploadFail(res) {
console.log("uploadFail", res)
},
// 退
sendback(){
var that = this;
this.form.ask_status = 1
that.util.request({
api: "/api/mobile/inspection/save",
method: "POST",
data: that.form,
utilSuccess: function(res) {
uni.showToast({
icon: "none",
title: "提交成功",
complete() {
that.afterSubmit(res);
},
duration: 2000
})
},
utilFail: function(res) {
that.util.alert(res);
}
});
},
submit() {
var that = this;
let pic = []
let fileListObj = {
pics: {
arr: this.picFileList,
type: 4
},
videos: {
arr: this.videoFileList,
type: 5
},
audios: {
arr: this.audioFileList,
type: 7
}
}
for (var m in fileListObj) {
for (var k of fileListObj[m]['arr']) {
pic.push({
upload_id: k.id,
type: fileListObj[m]['type']
})
}
}
this.form.inspection_file_list = pic
this.form.ask_status = 4
// return
this.$refs.uForm.validate(valid => {
if (valid) {
that.util.request({
api: "/api/mobile/inspection/save",
method: "POST",
data: that.form,
utilSuccess: function(res) {
uni.showToast({
icon: "none",
title: "提交成功",
complete() {
that.afterSubmit(res);
},
duration: 2000
})
},
utilFail: function(res) {
that.util.alert(res);
}
});
} else {
console.log('验证失败');
}
})
},
afterSubmit() {
uni.redirectTo({
url: "../solve/index"
})
},
}
}
</script>
<style scoped>
.wrap {
background-color: #F3F5F5;
min-height: 100vh;
padding-top: 25rpx
}
.info {
padding: 30rpx;
background-color: #fff;
margin: 25rpx;
border-radius: 30rpx;
margin-top: 0
}
.info .u-row {
margin: 15rpx 0
}
.info .u-row .u-col:first-child {
text-align: right !important;
}
.btns{
text-align: center;
}
.btns .u-btn {
width: 40%;
display: inline-block;
margin: 5%;
}
</style>
Loading…
Cancel
Save