|
|
|
|
@ -44,7 +44,8 @@ |
|
|
|
|
<view class="con-btn"> |
|
|
|
|
<!-- 客户 --> |
|
|
|
|
<u-button size="mini" plain style="margin-right:16rpx" @click.stop="openWorkOrder(item)">查看</u-button> |
|
|
|
|
<!-- <u-button size="mini" plain style="margin-right:16rpx" @click="openModel(item, 'details')">下载</u-button> --> |
|
|
|
|
<u-button size="mini" plain style="margin-right:16rpx" @click="handleExport(item)" |
|
|
|
|
v-if="item.status == 202 || item.status == 203 || item.status == 204">报告</u-button> |
|
|
|
|
<u-button size="mini" plain style="margin-right:16rpx" @click="openLog(item)">日志</u-button> |
|
|
|
|
<block v-if="dataTypes == 1"> |
|
|
|
|
<!-- 工单详情 查看维修详情 --> |
|
|
|
|
@ -58,10 +59,11 @@ |
|
|
|
|
<u-button v-if="item.status == 405" size="mini" :plain="true" style="margin-right:16rpx" |
|
|
|
|
:hair-line="true" type="primary" @click="openModel(item, 'repairConfirm')">确认</u-button> |
|
|
|
|
|
|
|
|
|
<u-button v-if="item.status == 103" size="mini" :plain="true" style="margin-right:16rpx" |
|
|
|
|
:hair-line="true" type="primary" @click="goPageLocation(item)">查看位置</u-button> |
|
|
|
|
<u-button v-if="item.status == 403 || item.status == 202|| item.status == 406" size="mini" :plain="true" |
|
|
|
|
<u-button v-if="item.status == 103 || item.status == 404" size="mini" :plain="true" |
|
|
|
|
style="margin-right:16rpx" :hair-line="true" type="primary" |
|
|
|
|
@click="goPageLocation(item)">查看位置</u-button> |
|
|
|
|
<u-button v-if="item.status == 403 || item.status == 202 || item.status == 406" size="mini" |
|
|
|
|
:plain="true" style="margin-right:16rpx" :hair-line="true" type="primary" |
|
|
|
|
@click="openEvaluate(item)">评价</u-button> |
|
|
|
|
</block> |
|
|
|
|
<!-- 客服 --> |
|
|
|
|
@ -96,7 +98,7 @@ |
|
|
|
|
<u-button v-if="item.status == 401 || item.status == 300 || item.status == 105" size="mini" |
|
|
|
|
:plain="true" style="margin-right:16rpx" type="primary" @click="orderConfirm(item)">提交</u-button> |
|
|
|
|
<u-button v-if="item.status == 103 || item.status == 401 || item.status == 404" size="mini" |
|
|
|
|
:plain="true" style="margin-right:16rpx" type="primary" |
|
|
|
|
:plain="true" type="primary" |
|
|
|
|
@click="openModel(item, 'repair')">维修完成</u-button> |
|
|
|
|
</block> |
|
|
|
|
|
|
|
|
|
@ -219,6 +221,7 @@ export default { |
|
|
|
|
requirementCode: '',//单号 |
|
|
|
|
repairTypeList: [],//维修类型列表 |
|
|
|
|
repairConfirmShow: false,//客户确认维修效果弹框 |
|
|
|
|
userInfo: {},//用户信息 |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
@ -227,6 +230,11 @@ export default { |
|
|
|
|
}, |
|
|
|
|
dataTypes() { |
|
|
|
|
this.tabList = tabList[this.$store.state.dataType] |
|
|
|
|
|
|
|
|
|
if (this.requirementCode != '') { |
|
|
|
|
this.current = this.tabList.length-1 |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return this.$store.state.dataType |
|
|
|
|
}, |
|
|
|
|
tagColor() { |
|
|
|
|
@ -249,22 +257,27 @@ export default { |
|
|
|
|
onLoad(options) { |
|
|
|
|
this.type = options.type ? options.type : '' |
|
|
|
|
this.requirementCode = options.requirementCode ? options.requirementCode : '' |
|
|
|
|
|
|
|
|
|
this.userInfo = uni.getStorageSync("userinfo"); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
onShow() { |
|
|
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.getMesseageTotal() |
|
|
|
|
if (this.type == '') { |
|
|
|
|
this.$refs.tabbarRef.getPermission(); |
|
|
|
|
} |
|
|
|
|
if (this.requirementCode != '') { |
|
|
|
|
this.current = 0 |
|
|
|
|
this.searchInfo.requirementCode = this.requirementCode |
|
|
|
|
} else { |
|
|
|
|
// this.current = 1 |
|
|
|
|
// this.changeTab(1) |
|
|
|
|
if(this.searchInfo.statusSearch == ''){ |
|
|
|
|
this.searchInfo.statusSearch = this.tabList[0].key == '9999' ? '' : this.tabList[0].key |
|
|
|
|
}else{ |
|
|
|
|
this.searchInfo.statusSearch = this.tabList[0].key == '9999' ? '' : this.searchInfo.statusSearch |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.getType() |
|
|
|
|
this.getRecordsList() |
|
|
|
|
}); |
|
|
|
|
@ -277,7 +290,7 @@ export default { |
|
|
|
|
let query = { |
|
|
|
|
current: this.page.currentPage, //页数 |
|
|
|
|
size: this.page.pageSize, //条数 |
|
|
|
|
dataType: this.dataTypes,//数据权限 |
|
|
|
|
dataType:this.userInfo.role_id=='1123598816738675201'?'': this.dataTypes,//数据权限 |
|
|
|
|
...this.searchInfo |
|
|
|
|
} |
|
|
|
|
this.$u.api.getWorkOrderRecords(query).then(res => { |
|
|
|
|
@ -405,7 +418,7 @@ export default { |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 客服关闭 |
|
|
|
|
// 弹框 |
|
|
|
|
openModel(item, type) { |
|
|
|
|
if (type == 'close') { |
|
|
|
|
this.cloneVisible = true |
|
|
|
|
@ -555,6 +568,7 @@ export default { |
|
|
|
|
goPageLocation(item) { |
|
|
|
|
let param = { |
|
|
|
|
userid: item.repairPerson, |
|
|
|
|
repairPerson: item.repairPerson |
|
|
|
|
} |
|
|
|
|
//查看位置 |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
@ -645,6 +659,80 @@ export default { |
|
|
|
|
this.getRecordsList() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 导出报告 |
|
|
|
|
handleExport(item) { |
|
|
|
|
this.$u.api.downLoadFile('lab-ops/work-order/report-service', item).then(res => { |
|
|
|
|
|
|
|
|
|
const blob = new Blob([res]); |
|
|
|
|
// this.downloadXls(blob) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
uploadFile(filePath) { |
|
|
|
|
const token = uni.getStorageSync("token") |
|
|
|
|
uni.uploadFile({ |
|
|
|
|
url: website.baseUrl + "/blade-resource/oss/endpoint/put-file", // 服务器上传接口 |
|
|
|
|
filePath: filePath, |
|
|
|
|
name: "file", // 必须填写,后台用来接收文件 |
|
|
|
|
header: { |
|
|
|
|
'Blade-Auth': 'bearer ' + token, |
|
|
|
|
'Authorization': `Basic ${Base64.encode(`${website.clientId}:${website.clientSecret}`)}`, |
|
|
|
|
'blade-requested-with': 'BladeHttpRequest' //自定义请求头 |
|
|
|
|
}, |
|
|
|
|
formData: {}, |
|
|
|
|
success: (res) => { |
|
|
|
|
let info = JSON.parse(res.data); |
|
|
|
|
console.log("上传成功", info); // 上传成功后的操作 |
|
|
|
|
|
|
|
|
|
this.fileList.push({ |
|
|
|
|
'link': info.data.link, |
|
|
|
|
'name': info.data.name |
|
|
|
|
}); |
|
|
|
|
this.$emit('changeFile', this.fileList, this.formIndex) |
|
|
|
|
this.$refs.BetLoading.hide() |
|
|
|
|
}, |
|
|
|
|
error: (uploadFileRes) => { |
|
|
|
|
// console.log("上传失败", uploadFileRes.data); // 上传成功后的操作 |
|
|
|
|
this.$refs.BetLoading.hide() |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
downloadXls(data) { |
|
|
|
|
|
|
|
|
|
//获取当前设备的默认环境路径 |
|
|
|
|
const Environment = plus.android.importClass('android.os.Environment') |
|
|
|
|
let filePathTemp = 'file://' + Environment.getExternalStorageDirectory() + '/Download/siyu-logs/' |
|
|
|
|
// 创建临时文件路径 http://124.221.142.15:9000/laboratory/upload/20241231/57faa52e4fdf02f94a3b40d0c7089b29.pdf |
|
|
|
|
console.log('filePathTemp', filePathTemp) |
|
|
|
|
// 获取文件系统管理器 |
|
|
|
|
const fileManager = uni.getFileSystemManager(); |
|
|
|
|
console.log('data', data) |
|
|
|
|
// 写入文件 |
|
|
|
|
fileManager.writeFile({ |
|
|
|
|
filePath: filePathTemp, |
|
|
|
|
data: data, |
|
|
|
|
encoding: 'binary', |
|
|
|
|
success: (res) => { |
|
|
|
|
console.log('文件写入成功'); |
|
|
|
|
|
|
|
|
|
// 保存文件到本地 |
|
|
|
|
uni.saveFile({ |
|
|
|
|
tempFilePath: filePath, |
|
|
|
|
success: (saveRes) => { |
|
|
|
|
console.log('文件保存成功', saveRes.savedFilePath); |
|
|
|
|
// 文件保存成功后的路径 |
|
|
|
|
const savedFilePath = saveRes.savedFilePath; |
|
|
|
|
// 可以执行后续操作,比如提示用户文件保存位置等 |
|
|
|
|
}, |
|
|
|
|
fail: (err) => { |
|
|
|
|
console.error('文件保存失败', err); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
fail: (err) => { |
|
|
|
|
console.error('文件写入失败', err); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
|