1
This commit is contained in:
parent
fd3deaac0e
commit
375ca5b3eb
6
main.js
6
main.js
@ -37,15 +37,15 @@ if (process.env.NODE_ENV === 'development') {
|
||||
console.log('开发环境')
|
||||
// Vue.prototype.url_config = 'http://47.93.215.234:9809/' // 鞍钢正式地址(弃用)
|
||||
// Vue.prototype.url_config = 'http://42.180.188.17:9809/' // 鞍钢正式地址
|
||||
Vue.prototype.url_config = 'http://42.180.188.17:11211/' // 鞍钢测试地址
|
||||
// Vue.prototype.url_config = 'http://42.180.188.17:11211/' // 鞍钢测试地址
|
||||
// Vue.prototype.url_config = 'http://182.90.224.237:51234/' //雄哥内网穿透地址
|
||||
// Vue.prototype.url_config = 'http://jxj.zhgdyun.com:61212/' //杰哥内网穿透地址
|
||||
// Vue.prototype.url_config = ' http://192.168.34.221:28888/' //郭圣雄本地
|
||||
// Vue.prototype.url_config = 'http://192.168.34.221:9111/' //郭圣雄本地
|
||||
Vue.prototype.url_config = 'http://192.168.34.221:9111/' //郭圣雄本地
|
||||
// Vue.prototype.url_config = 'http://192.168.34.155:19111/' //彭洁本地
|
||||
// Vue.prototype.work_url = 'http://47.93.215.234:19997' // 工作流线上地址(弃用)
|
||||
// Vue.prototype.work_url = 'http://42.180.188.17:19997' // 工作流线上地址
|
||||
Vue.prototype.work_url = 'http://42.180.188.17:19097' // 工作流测试地址
|
||||
// Vue.prototype.work_url = 'http://42.180.188.17:19097' // 工作流测试地址
|
||||
// Vue.prototype.work_url = 'http://192.168.34.138:5173' // 工作流地址
|
||||
// Vue.prototype.work_url = 'http://139.9.66.234:5173' // 工作流地址
|
||||
// Vue.prototype.work_url = 'http://192.168.34.126:5173' // 工作流地址
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
</view>
|
||||
<view class="btns">
|
||||
<view class="user feedback" @click="goto('user')">用户登录</view>
|
||||
<!-- <view class="feedback personLocation" @click="gotoPersonLocation()">施工人员登录</view> -->
|
||||
<view class="feedback personLocation" @click="gotoPersonLocation()">施工人员登录</view>
|
||||
<!-- <view class="user feedback" @click="goto('user')">我是用户</view> -->
|
||||
<!-- <view class="supplier feedback black" @click="goto('supplier')">我是供应商</view> -->
|
||||
</view>
|
||||
|
||||
@ -93,14 +93,16 @@
|
||||
<view class="rescue-detail data">
|
||||
<view>
|
||||
<text>处置资料:</text>
|
||||
<text v-if="emergencyInfo.disposalInformation" style="cursor: pointer;word-wrap:break-word; word-break:break-all;" class="color-518"
|
||||
<text v-if="emergencyInfo.disposalInformation"
|
||||
style="cursor: pointer;word-wrap:break-word; word-break:break-all;" class="color-518"
|
||||
@click="downloadReport(emergencyInfo.disposalInformation)">
|
||||
{{ JSON.parse(emergencyInfo.disposalInformation).map(item => item.name).join("、") }}
|
||||
</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>指导文件:</text>
|
||||
<text v-if="emergencyInfo.guidanceDocument" style="cursor: pointer;word-wrap:break-word; word-break:break-all;" class="color-518"
|
||||
<text v-if="emergencyInfo.guidanceDocument"
|
||||
style="cursor: pointer;word-wrap:break-word; word-break:break-all;" class="color-518"
|
||||
@click="downloadReport(emergencyInfo.guidanceDocument)">
|
||||
{{ JSON.parse(emergencyInfo.guidanceDocument).map(item => item.name).join("、") }}
|
||||
</text>
|
||||
@ -167,7 +169,7 @@
|
||||
</view>
|
||||
<view v-if="emergencyDetail.dispositionStatus != 3">
|
||||
<view class="rescue-report">
|
||||
<uni-file-picker limit="1" @select="canversList" file-mediatype="all" title="最多选择1个文件">
|
||||
<uni-file-picker v-model="imgList" limit="1" @select="canversList" file-mediatype="all" title="最多选择1个文件">
|
||||
<!-- <image src="/static/icon-add.png" class="icon-add"></image> -->
|
||||
<uni-icons2 type="plusempty" :size="19"></uni-icons2>
|
||||
选择文件
|
||||
@ -230,8 +232,9 @@
|
||||
},
|
||||
methods: {
|
||||
downloadReport(row) {
|
||||
const url = row && row != "null" && row[0].url;
|
||||
const fileName = row && row != "null" && row[0].name;
|
||||
console.log(JSON.parse(row));
|
||||
const url = row != "null" && JSON.parse(row).length > 0 && JSON.parse(row)[0].url;
|
||||
const fileName = row != "null"&& JSON.parse(row).length > 0 && JSON.parse(row)[0].name;
|
||||
if (!url) {
|
||||
uni.showToast({
|
||||
title: "暂无下载文件!",
|
||||
@ -246,7 +249,7 @@
|
||||
url: url, //网络路径,下载下来
|
||||
success: (res) => {
|
||||
if (res.statusCode === 200) {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
uni.saveFile({
|
||||
filePath: res.tempFilePath, //下载后的临时路径
|
||||
success: res => { //下载完成后在相册里压根找不到
|
||||
uni.hideLoading()
|
||||
@ -255,22 +258,35 @@
|
||||
})
|
||||
}
|
||||
})
|
||||
console.log(111111);
|
||||
// uni.saveImageToPhotosAlbum({ // 然后调用这个方法
|
||||
// filePath: res.tempFilePath,
|
||||
// success: (res) => {
|
||||
// uni.hideLoading(); //关闭提示
|
||||
// uni.showToast({
|
||||
// title: '保存成功'
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading(); //关闭提示
|
||||
},
|
||||
});
|
||||
|
||||
// fetch(url)
|
||||
// .then(response => response.blob())
|
||||
// .then(blob => {
|
||||
// const link = document.createElement('a');
|
||||
// link.href = URL.createObjectURL(blob);
|
||||
// link.download = fileName;
|
||||
// link.target = "_blank"; // 可选,如果希望在新窗口中下载文件,请取消注释此行
|
||||
// link.click();
|
||||
// });
|
||||
fetch(url)
|
||||
.then(response => response.blob())
|
||||
.then(blob => {
|
||||
const link = document.createElement('a');
|
||||
link.href = URL.createObjectURL(blob);
|
||||
link.download = fileName;
|
||||
link.target = "_blank"; // 可选,如果希望在新窗口中下载文件,请取消注释此行
|
||||
link.click();
|
||||
});
|
||||
},
|
||||
addSaveBtn() {
|
||||
if (this.imgList == null||this.imgList.length == 0) {
|
||||
if (this.imgList == null || this.imgList.length == 0) {
|
||||
uni.showToast({
|
||||
title: "请提交处置报告",
|
||||
icon: "none"
|
||||
@ -303,7 +319,17 @@
|
||||
},
|
||||
canversList(e) {
|
||||
const that = this;
|
||||
console.log(e);
|
||||
const accept=["doc", "docx", "xls", "xlsx", "ppt", "pptx", "pdf","txt"]
|
||||
const findIndex = accept.findIndex(item => item == e.tempFiles[0].extname);
|
||||
// console.log(findIndex,e.tempFiles[0].extname);
|
||||
if(findIndex == -1){
|
||||
that.imgList = [];
|
||||
uni.showToast({
|
||||
title: '请上传文件类型!',
|
||||
icon:"none"
|
||||
})
|
||||
return
|
||||
}
|
||||
that.imgList = that.imgList == null ? [] : that.imgList;
|
||||
uni.uploadFile({
|
||||
url: that.url_config + 'upload/image', //仅为示例,非真实的接口地址
|
||||
@ -360,7 +386,8 @@
|
||||
const find = that.emergencyTypeList.find(item => item.id == res.result
|
||||
.emergencyTypeId);
|
||||
that.emergencyInfo = find ? find : {};
|
||||
this.imgList = (res.result.disposalReport && res.result.disposalReport != null) ? JSON.parse(res.result.disposalReport) : [];
|
||||
this.imgList = (res.result.disposalReport && res.result.disposalReport != null) ? JSON
|
||||
.parse(res.result.disposalReport) : [];
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<view class="emergencyDisposal">
|
||||
<headers class="fixedheader" :showBack="true">
|
||||
<view class="headerName">
|
||||
{{this.getGoId == 2 ? '救援隐患审批' :'应急处置'}}
|
||||
{{this.getGoId == 2 ? '救援隐患审批' :'应急处置'}}
|
||||
</view>
|
||||
</headers>
|
||||
<view class="problemOverview" :style="{ 'margin-top': (statusBarHeight+52) + 'px' }">
|
||||
|
||||
@ -93,14 +93,16 @@
|
||||
<view class="rescue-detail data">
|
||||
<view>
|
||||
<text>处置资料:</text>
|
||||
<text v-if="emergencyInfo.disposalInformation" style="cursor: pointer;word-wrap:break-word; word-break:break-all;" class="color-518"
|
||||
<text v-if="emergencyInfo.disposalInformation"
|
||||
style="cursor: pointer;word-wrap:break-word; word-break:break-all;" class="color-518"
|
||||
@click="downloadReport(emergencyInfo.disposalInformation)">
|
||||
{{ JSON.parse(emergencyInfo.disposalInformation).map(item => item.name).join("、") }}
|
||||
</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>指导文件:</text>
|
||||
<text v-if="emergencyInfo.guidanceDocument" style="cursor: pointer;word-wrap:break-word; word-break:break-all;" class="color-518"
|
||||
<text v-if="emergencyInfo.guidanceDocument"
|
||||
style="cursor: pointer;word-wrap:break-word; word-break:break-all;" class="color-518"
|
||||
@click="downloadReport(emergencyInfo.guidanceDocument)">
|
||||
{{ JSON.parse(emergencyInfo.guidanceDocument).map(item => item.name).join("、") }}
|
||||
</text>
|
||||
@ -121,7 +123,7 @@
|
||||
<text>{{item.disposalPersonName}}</text>
|
||||
</view>
|
||||
<!-- style="flex-direction: column;" -->
|
||||
<view >
|
||||
<view>
|
||||
<text>现场情况视频:</text>
|
||||
<view v-if="item.liveVideoSituation && JSON.parse(item.liveVideoSituation).length>0"
|
||||
class="imgBox flex2" v-for="(ele,index) in JSON.parse(item.liveVideoSituation)"
|
||||
@ -215,8 +217,8 @@
|
||||
},
|
||||
methods: {
|
||||
downloadReport(row) {
|
||||
const url = row && row != "null" && row[0].url;
|
||||
const fileName = row && row != "null" && row[0].name;
|
||||
const url = row != "null" && JSON.parse(row).length > 0 && JSON.parse(row)[0].url;
|
||||
const fileName = row != "null" && JSON.parse(row).length > 0 && JSON.parse(row)[0].name;
|
||||
if (!url) {
|
||||
uni.showToast({
|
||||
title: "暂无下载文件!",
|
||||
@ -227,22 +229,47 @@
|
||||
uni.showLoading({
|
||||
title: "保存中..."
|
||||
})
|
||||
console.log(url);
|
||||
uni.downloadFile({
|
||||
url: url, //网络路径,下载下来
|
||||
success: (res) => {
|
||||
if (res.statusCode === 200) {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: res.tempFilePath, //下载后的临时路径
|
||||
success: res => { //下载完成后在相册里压根找不到
|
||||
uni.hideLoading()
|
||||
// uni.saveFile({
|
||||
// filePath: res.tempFilePath, //下载后的临时路径
|
||||
// success: res => { //下载完成后在相册里压根找不到
|
||||
// uni.hideLoading()
|
||||
// uni.showToast({
|
||||
// title: "保存成功!"
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
uni.saveImageToPhotosAlbum({ // 然后调用这个方法
|
||||
filePath: res.tempFilePath,
|
||||
success: (res) => {
|
||||
uni.hideLoading(); //关闭提示
|
||||
uni.showToast({
|
||||
title: "保存成功!"
|
||||
title: '图片已保存'
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading(); //关闭提示
|
||||
},
|
||||
});
|
||||
// #ifdef H5
|
||||
fetch(url)
|
||||
.then(response => response.blob())
|
||||
.then(blob => {
|
||||
const link = document.createElement('a');
|
||||
link.href = URL.createObjectURL(blob);
|
||||
link.download = fileName;
|
||||
link.target = "_blank"; // 可选,如果希望在新窗口中下载文件,请取消注释此行
|
||||
link.click();
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
onSubmitAll() {
|
||||
this.sendRequest({
|
||||
@ -586,8 +613,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
.imgBox_wrap,.imgBox {
|
||||
.imgBox_wrap,
|
||||
.imgBox {
|
||||
margin: 0 !important;
|
||||
|
||||
view {
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user