用户上报故障对接接口
This commit is contained in:
parent
e7ce5a2eeb
commit
1732c2eb38
@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<view class="container" :style="{ height: scrollHeight -113+ 'px' }">
|
||||
<scroll-view class="scroll-container" :scroll-y="isScrollY" :style="{ height: scrollHeight-113 + 'px' }">
|
||||
<uni-card>
|
||||
|
||||
<view class="padding">
|
||||
<uni-forms>
|
||||
<uni-forms-item label="车辆编号">
|
||||
<uni-easyinput :disabled="true" v-model="bikeCode" placeholder="车辆编号" />
|
||||
</uni-forms-item>
|
||||
<span @click="goToSH">去审核</span>
|
||||
</uni-forms>
|
||||
|
||||
</uni-card>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="containerup">
|
||||
<view class="titleup">
|
||||
@ -116,7 +116,7 @@
|
||||
const delChangeImg = (res) => {
|
||||
const fileUniqueKey = fileLists.value[res.index].fileUniqueKey;
|
||||
fileLists.value.splice(res.index, 1);
|
||||
api.callEbikeInfo("deletedFile?fileUniqueKey=" + fileUniqueKey, {}, "get");
|
||||
api.callMaintenanceApi("ebikeOrdersSystem/deletedFile?fileUniqueKey=" + fileUniqueKey, {}, "get");
|
||||
}
|
||||
const isScrollY = ref(true)
|
||||
const getEndDetail = ({
|
||||
@ -392,7 +392,7 @@
|
||||
.container {
|
||||
height: 100vh;
|
||||
padding: 0px 0px;
|
||||
background-color: #f3f4f6;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.example {
|
||||
@ -529,6 +529,7 @@
|
||||
|
||||
.chetoubox {
|
||||
margin: 10px;
|
||||
border-radius: 10px;
|
||||
padding: 10px;
|
||||
box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.3)
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
<view>
|
||||
<view v-show="selectedTab === 'consume'">
|
||||
<!-- 审核处理的具体内容 -->
|
||||
<scroll-view scroll-y="true" :style="{ height: scrollHeight-145 + 'px' }">
|
||||
<scroll-view scroll-y="true" :style="{ height: (scrollHeight - 190) + 'px', marginTop: '10px' }">
|
||||
<view class="content">
|
||||
<view class="card">
|
||||
<view class="card-header">
|
||||
@ -70,17 +70,20 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</scroll-view>
|
||||
<view class="nav-panel">
|
||||
<view class="warning-message">
|
||||
<uni-icons type="info" color="#c1c1c1" size="20"></uni-icons>
|
||||
<span>故障上报属实后车辆不可被用户租用</span>
|
||||
</view>
|
||||
|
||||
<uni-goods-nav :fill="true" :options="[]" :buttonGroup="navButtonGroup"
|
||||
@buttonClick="navButtonClick" />
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<view v-show="selectedTab === 'report'">
|
||||
<view class="">
|
||||
|
||||
<view class="query-selector">
|
||||
<view class="query-option" :class="{ 'query-select': selectedOption === option }"
|
||||
v-for="(option, index) in options" :key="index" @click="selectOption(option)">
|
||||
@ -90,9 +93,9 @@
|
||||
<scroll-view scroll-y="true" :style="{ height: scrollHeight-170 + 'px' }">
|
||||
|
||||
<view v-for="(item,index) in dataList" :key="index">
|
||||
<uni-card>
|
||||
<view style=" margin: 8px; background: #fff; border-radius: 10px; padding: 5px 10px;">
|
||||
<uni-forms>
|
||||
<view class="flex justify-between" style="margin: 5px 0px;">
|
||||
<view class="flex justify-between" style="margin: 10px 0px;">
|
||||
<view class="label">
|
||||
用户姓名
|
||||
</view>
|
||||
@ -100,13 +103,13 @@
|
||||
<view class="deepBlackBoldText">
|
||||
{{ item.reportUser }}
|
||||
</view>
|
||||
<view v-if="item.phoneNumber" @click="makeACall(item.phoneNumber)">
|
||||
<view v-if="item.mobile" @click="makeACall(item.mobile)">
|
||||
<text style="font-size: 18px; color: orange;"
|
||||
class="cuIcon-phone"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-between" style="margin: 5px 0px;">
|
||||
<view class="flex justify-between" style="margin: 10px 0px;">
|
||||
<view class="label">
|
||||
上报来源
|
||||
</view>
|
||||
@ -114,7 +117,7 @@
|
||||
{{ item.reportSource }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-between" style="margin: 5px 0px;">
|
||||
<view class="flex justify-between" style="margin: 10px 0px;">
|
||||
<view class="label">
|
||||
订单编号
|
||||
</view>
|
||||
@ -128,7 +131,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-between" style="margin: 5px 0px;">
|
||||
<view class="flex justify-between" style="margin: 10px 0px;">
|
||||
<view class="label">
|
||||
上报时间
|
||||
</view>
|
||||
@ -136,7 +139,7 @@
|
||||
{{ item.reportAt }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-between" style="margin: 5px 0px;">
|
||||
<view class="flex justify-between" style="margin: 10px 0px;">
|
||||
<view class="label">
|
||||
故障部件
|
||||
</view>
|
||||
@ -144,7 +147,7 @@
|
||||
{{ item.faultPart }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-between" style="margin: 5px 0px;">
|
||||
<view class="flex justify-between" style="margin: 10px 0px;">
|
||||
<view class="label">
|
||||
故障原因
|
||||
</view>
|
||||
@ -152,21 +155,21 @@
|
||||
{{ item.faultDescription }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-between" style="margin: 5px 0px;">
|
||||
<view class="flex justify-between" style="margin: 10px 0px;">
|
||||
<view class="label">
|
||||
上报图片
|
||||
</view>
|
||||
<view class="deepBlackBoldText" style="width: 75%;">
|
||||
<uni-file-picker readonly="true" limit="9"
|
||||
:value="formatImageFiles(item.attachmentFiles)"></uni-file-picker>
|
||||
:value="item.reportAttachments"></uni-file-picker>
|
||||
</view>
|
||||
</view>
|
||||
</uni-forms>
|
||||
</uni-card>
|
||||
<view style="height: 20px;">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view style="height: 10px;">
|
||||
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
</view>
|
||||
@ -258,11 +261,11 @@
|
||||
const baseFormData = ref([]);
|
||||
const results = ref([{
|
||||
text: '属实',
|
||||
value: 0
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
text: '虚假',
|
||||
value: 1
|
||||
value: 0
|
||||
}
|
||||
]);
|
||||
|
||||
@ -302,47 +305,81 @@
|
||||
}
|
||||
const delChangeImg = (res) => {
|
||||
const fileUniqueKey = fileLists.value[res.index].fileUniqueKey;
|
||||
fileLists.value.splice(res.index, 1);
|
||||
if (!fileLists.value[res.index].nodelete) {
|
||||
api.callEbikeInfo("deletedFile?fileUniqueKey=" + fileUniqueKey, {}, "get");
|
||||
}
|
||||
fileLists.value.splice(res.index, 1);
|
||||
}
|
||||
const userInfo = ref(null);
|
||||
onLoad((options) => {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
userInfo.value = uni.getStorageSync('userInfo');
|
||||
const screenHeight = systemInfo.screenHeight;
|
||||
const statusBarHeight = systemInfo.statusBarHeight;
|
||||
scrollHeight.value = screenHeight - statusBarHeight;
|
||||
bikeCode.value = "250306001002";
|
||||
loadMoreData();
|
||||
showInfo();
|
||||
})
|
||||
onMounted(() => {
|
||||
// 获取设备信息
|
||||
});
|
||||
const formatImageFiles = (data) => {
|
||||
let imglist = [];
|
||||
data.forEach(res => {
|
||||
let map = {
|
||||
url: res.fileUrl,
|
||||
extname: 'png',
|
||||
name: res.fileName
|
||||
};
|
||||
imglist.push(map);
|
||||
})
|
||||
return imglist;
|
||||
|
||||
const showInfo = () => {
|
||||
api.callMaintenanceApi("ebikeFaultreportReview/getInfo?bikeCode=" + bikeCode.value, {}, 'get').then((
|
||||
res) => {
|
||||
if (res.code == 200) {
|
||||
workorderId.value = res.data.reviewId;
|
||||
loadMoreData();
|
||||
} else {
|
||||
|
||||
loadMoreData();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const workorderId = ref("")
|
||||
const reportfaults = ref(null);
|
||||
const dataList = ref([])
|
||||
const dataListAll = ref([]);
|
||||
const loadMoreData = () => {
|
||||
// 组装参数
|
||||
api.callOrdereApi("ebikeUserFaultreport/list?bikeCode=" + bikeCode.value, {}, 'get').then((
|
||||
let params = {}
|
||||
if (workorderId.value) {
|
||||
params = {
|
||||
"bikeCode": bikeCode.value,
|
||||
"workorderId": workorderId.value
|
||||
}
|
||||
} else {
|
||||
params = {
|
||||
"bikeCode": bikeCode.value
|
||||
}
|
||||
}
|
||||
api.callMaintenanceApi("ebikeFaultreportReview/userFaultreports", params).then((
|
||||
res) => {
|
||||
if (res.code == 200) {
|
||||
dataListAll.value = res.data;
|
||||
updateOptions(res.data, options.value);
|
||||
dataList.value = res.data;
|
||||
if (!workorderId.value) {
|
||||
updateOptions(res.data, faultyParts.value);
|
||||
collectAndSaveImages(res.data);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const collectAndSaveImages = (data) => {
|
||||
data.forEach(res => {
|
||||
res.reportAttachments.forEach(s => {
|
||||
s.nodelete = true; // 给每个附件加上 nodelete 属性
|
||||
});
|
||||
fileLists.value = fileLists.value.concat(res.reportAttachments); // 合并数组,避免重复赋值
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
function updateOptions(dataList, options) {
|
||||
dataList.forEach(res => {
|
||||
// 判断 faultPart 是否包含 "|"
|
||||
@ -370,13 +407,12 @@
|
||||
// 添加故障部件
|
||||
const addFaultyPart = () => {
|
||||
// 这里可以修改成你想要添加的部件内容
|
||||
popup.value.open("center");
|
||||
|
||||
let data = faultyParts.value;
|
||||
selectedParts.value = [];
|
||||
data.forEach(res => {
|
||||
selectedParts.value.push(res);
|
||||
})
|
||||
popup.value.open("center");
|
||||
};
|
||||
|
||||
// 删除故障部件
|
||||
@ -388,16 +424,41 @@
|
||||
popup.value.close("center");
|
||||
}
|
||||
const navButtonClick = (index, content) => {
|
||||
if (!checkscan()) {
|
||||
return
|
||||
}
|
||||
uni.showModal({
|
||||
title: '确认提交',
|
||||
content: '您确定要进行提交操作吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
const params = {
|
||||
// "reviewId": "string",
|
||||
"faultParts": faultyParts.value.join("|"),
|
||||
"result": baseFormData.value.result,
|
||||
"remark": baseFormData.value.remark,
|
||||
"bikeCode": bikeCode.value,
|
||||
// "reviewTime": "string",
|
||||
"reviewer": userInfo.value.staffId,
|
||||
// "isDelete": "string",
|
||||
// "deleteTime": "string",
|
||||
// "dealState": "string",
|
||||
"attachmentFiles": fileLists.value,
|
||||
"faultReports": dataListAll.value
|
||||
}
|
||||
api.callMaintenanceApi("ebikeFaultreportReview/save", params).then(res => {
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
title: '提交成功',
|
||||
icon: 'success',
|
||||
duration: 500
|
||||
});
|
||||
setTimeout(() => {
|
||||
|
||||
uni.switchTab({
|
||||
url: "/pages/user/mine/MePage"
|
||||
})
|
||||
}, 500);
|
||||
}
|
||||
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户取消出库');
|
||||
}
|
||||
@ -528,7 +589,6 @@
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-top: 10px;
|
||||
padding-bottom: 70px;
|
||||
padding: 10px;
|
||||
background-color: #fff;
|
||||
@ -580,7 +640,8 @@
|
||||
|
||||
.fault-parts-container {
|
||||
width: 280px;
|
||||
padding: 20px 10px;
|
||||
padding: 10px 10px;
|
||||
border-radius: 10px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
@ -628,6 +689,7 @@
|
||||
color: rgb(134 134 134);
|
||||
overflow-wrap: break-word;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.uni-card__header {
|
||||
@ -662,4 +724,20 @@
|
||||
color: #ffffff;
|
||||
background: rgb(0, 132, 255);
|
||||
}
|
||||
|
||||
.uni-popup .uni-popup__wrapper {
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
/* 警告信息样式 */
|
||||
.warning-message {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 12px;
|
||||
letter-spacing: 1px;
|
||||
gap: 8px;
|
||||
color: #c1c1c1;
|
||||
padding-left: 20px;
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
Loading…
x
Reference in New Issue
Block a user