This commit is contained in:
2025-06-19 17:33:18 +08:00
commit f8f31dc4d9
437 changed files with 103080 additions and 0 deletions
@@ -0,0 +1,7 @@
{
"usingComponents": {
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index"
},
"navigationBarTitleText": "事故详情"
}
@@ -0,0 +1,210 @@
/* pages/backlog/accident/accident.wxss */
.container {
height: 100vh;
padding-top: 2px;
box-sizing: border-box;
background: #EFF1F4;
overflow: hidden;
position: relative;
>.bg {
width: 100%;
height: 250px;
position: absolute;
top: 0;
image {
width: 100%;
height: 100%;
display: block;
}
}
.top {
margin: 8px 8px 10px;
padding: 12px 10px;
margin-bottom: 8px;
background: #fff;
border-radius: 8px;
position: relative;
padding: 12px 10px;
.row:first-child {
margin-bottom: 8px;
}
.row {
color: #2E3A4F;
display: flex;
justify-content: space-between;
align-items: center;
.number-plate {
display: flex;
.status {
padding: 0 6px;
margin-right: 4px;
border-radius: 2px;
color: #FFFFFF;
font-size: 14px;
}
.status1 {
background: linear-gradient(90deg, #0D92FF 0%, #38B1FE 100%);
}
.status2 {
background: linear-gradient(270deg, #4CDBAD 0%, #2FCBAB 100%);
}
.status3 {
background: linear-gradient(270deg, #A1A8BB 0%, #838EAA 100%);
}
.val {
font-size: 16px;
font-weight: bold;
}
}
.project-name, .code {
font-size: 14px;
}
.time {
font-size: 14px;
color: #858CA0;
}
.type-list {
display: flex;
.type {
height: 22px;
line-height: 22px;
padding: 0 8px;
margin-left: 5px;
background: #FFF1F0;
border-radius: 4px;
border: 1px solid #FFA39E;
color: #FF4D4F;
font-size: 12px;
}
}
}
}
.detail-container {
max-height: calc(100vh - 72px - 80px - 20px);
box-sizing: border-box;
padding: 0px 8px 0px;
overflow: hidden;
position: relative;
.tabs {
display: flex;
background: #E2F3FE;
border-radius: 8px 8px 0 0;
overflow: hidden;
.tab {
width: 50%;
height: 40px;
line-height: 40px;
color: #959595;
font-size: 16px;
font-weight: bold;
text-align: center;
position: relative;
.bg {
width: 100%;
height: 100%;
position: absolute;
image {
width: 100%;
height: 100%;
display: block;
}
}
.value {
position: relative;
}
}
.active {
// background: #fff;
color: #4381FC;
}
.active::after {
content: '';
width: 26px;
height: 4px;
background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%);
border-radius: 2px;
position: absolute;
bottom: 2px;
left: 50%;
transform: translateX(-50%);
}
}
.content-borderall {
border-radius: 8px;
}
.content {
max-height: calc(100vh - 72px - 80px - 100px);
padding: 12px 10px;
// box-sizing: border-box;
border-radius: 0px 0px 8px 8px;
background: #fff;
overflow-y: auto;
.row {
margin-bottom: 8px;
display: flex;
justify-content: space-between;
// align-items: center;
.label {
margin-right: 4px;
color: #858CA0;
font-size: 14px;
white-space: nowrap;
}
.val {
color: #2E3A4F;
font-size: 14px;
}
.pic-box {
max-width: 70%;
display: flex;
justify-content: flex-end;
flex-wrap: wrap;
.item {
width: 84px;
height: 84px;
padding-left: 8px;
margin-bottom: 8px;
display: flex;
align-items: center;
image {
width: 100%;
height: 100%;
display: block;
}
video{
width: 100%;
height: 100%;
display: block;
}
}
}
}
}
}
.bottom {
width: 100%;
padding: 10px 8px 30px;
background: #fff;
box-sizing: border-box;
border-radius: 8px 8px 0 0;
box-shadow: 0px -2px 12px 0px rgba(0,0,0,0.2);
position: absolute;
bottom: 0;
left: 0;
.btn-box {
width: 100%;
display: flex;
justify-content: space-between;
.btn {
width: 100%;
height: 40px;
line-height: 40px;
border-radius: 8px;
background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%);
color: #fff;
font-weight: bold;
text-align: center;
}
}
}
}
@@ -0,0 +1,148 @@
// pages/backlog/accident/accident.ts
import { getAction } from '../../../api/base';
Page({
/**
* 页面的初始数据
*/
data: {
tabActive: 0,
id: '',
item: {} as any
},
// 变更tab
changeTab(e: any) {
console.log(e.currentTarget.dataset.tab);
this.setData({
tabActive: e.currentTarget.dataset.tab
});
},
getDetailInf() {
let parms = {
id: this.data.id
};
getAction('api/vehicles/backlog/getAccidentInfoById', parms).then(
(res: any) => {
if (res.code == 200) {
console.log(res.result);
res.result.accidentScenePhotoList = res.result.accidentScenePhoto
? res.result.accidentScenePhoto.split(',')
: [];
res.result.accidentSceneVideoList = res.result.accidentSceneVideo
? res.result.accidentSceneVideo.split(',')
: [];
res.result.insuranceInvestigationReportList = res.result
.insuranceInvestigationReport
? res.result.insuranceInvestigationReport.split(',')
: [];
res.result.accidentInsuranceInfo.documentImageList = res.result
.accidentInsuranceInfo.documentImage
? res.result.accidentInsuranceInfo.documentImage.split(',')
: [];
this.setData({
item: res.result
});
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
}
);
},
previewImg(e: any) {
let that = this;
let { index, key, key2 } = e.currentTarget.dataset;
if (key2) {
wx.previewImage({
current: that.data.item[key][key2][index | 0], // 当前显示图片的http链接 默认urls[0]
urls: that.data.item[key][key2] // 需要预览的图片http链接列表
});
} else {
wx.previewImage({
current: that.data.item[key][index | 0], // 当前显示图片的http链接 默认urls[0]
urls: that.data.item[key] // 需要预览的图片http链接列表
});
}
},
previewVidoe(e: any) {
let that = this;
let { index, key } = e.currentTarget.dataset;
let sources: any = that.data.item[key].map((item: any) => {
return {
type: 'video',
url: item
};
});
wx.previewMedia({
current: index,
sources: sources
});
},
toFeedback() {
let that = this;
// 违章信息
wx.setStorageSync('violation', '');
// 跳转到违章处理反馈
wx.navigateTo({
url: '../accidentFeedback/accidentFeedback',
success: function (res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('eventName', { ...that.data.item });
},
fail: e => {
console.log(e);
}
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
const eventChannel = this.getOpenerEventChannel();
getApp().EventChannel = eventChannel;
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
let id = wx.getStorageSync('backlogInf').id;
this.setData({
id: id
});
this.getDetailInf();
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
});
@@ -0,0 +1,254 @@
<!--pages/backlog/accident/accident.wxml-->
<view class="container">
<view class="bg">
<image src="../../../images/bg_page_blue.png" mode=""/>
</view>
<view class="top">
<view class="row">
<view class="number-plate">
<view class="val">{{item.plateNumber}}</view>
</view>
<view class="project-name">{{item.projectId_dictText}}</view>
</view>
<view class="row">
<view class="time">事故时间: {{item.accidentTime}}</view>
<view class="type-list">
<view class="type">{{item.natureEstimate_dictText}}</view>
</view>
</view>
</view>
<view class="detail-container">
<view class="tabs">
<view class="tab {{tabActive == 0 ? 'active' : ''}}" data-tab="0" catch:tap="changeTab">
<view class="bg" wx:if="{{tabActive == 0}}"><image src="../../../images/btn_l.png" mode=""/></view>
<view class="value">基础信息</view>
</view>
<view class="tab {{tabActive == 1 ? 'active' : ''}}" data-tab="1" catch:tap="changeTab">
<view class="bg" wx:if="{{tabActive == 1}}"><image src="../../../images/btn_r.png" mode=""/></view>
<view class="value">保险信息</view>
</view>
</view>
<view class="content" wx:if="{{tabActive == 0}}">
<view class="row">
<view class="label">车牌信息</view>
<view class="val">{{item.plateNumber}}</view>
</view>
<view class="row">
<view class="label">所属项目</view>
<view class="val">{{item.projectId_dictText ? item.projectId_dictText : '/'}}</view>
</view>
<view class="row">
<view class="label">处理人</view>
<view class="val">{{item.processedPerson ? item.processedPerson : '/'}}</view>
</view>
<view class="row">
<view class="label">报备号</view>
<view class="val">{{item.reportNumber ? item.reportNumber : '/'}}</view>
</view>
<view class="row">
<view class="label">事故发生时间</view>
<view class="val">{{item.accidentTime ? item.accidentTime : '/'}}</view>
</view>
<view class="row">
<view class="label">驾驶员</view>
<view class="val">{{item.driver ? item.driver : '/'}}</view>
</view>
<view class="row">
<view class="label">驾驶员证件</view>
<view class="val">{{item.driverLicenseNumber ? item.driverLicenseNumber : '/'}}</view>
</view>
<view class="row">
<view class="label">驾驶员电话</view>
<view class="val">{{item.driverPhoneNumber ? item.driverPhoneNumber : '/'}}</view>
</view>
<view class="row">
<view class="label">第三方车牌</view>
<view class="val">{{item.thirdPlateNumber ? item.thirdPlateNumber : '/'}}</view>
</view>
<view class="row">
<view class="label">第三方保险公司</view>
<view class="val">{{item.thirdInsuranceCompany ? item.thirdInsuranceCompany : '/'}}</view>
</view>
<view class="row">
<view class="label">第三方电话</view>
<view class="val">{{item.thirdPhoneNumber ? item.thirdPhoneNumber : '/'}}</view>
</view>
<view class="row">
<view class="label">事故发生地点</view>
<view class="val">{{item.accidentLocation ? item.accidentLocation : '/'}}</view>
</view>
<view class="row">
<view class="label">事故发生经过</view>
<view class="val">{{item.accidentDetails ? item.accidentDetails : '/'}}</view>
</view>
<view class="row">
<view class="label">事故发生损失</view>
<view class="val">{{item.accidentEstimatedLoss ? item.accidentEstimatedLoss : '/'}}</view>
</view>
<view class="row">
<view class="label">事故发生类型</view>
<view class="val">{{item.accidentForm_dictText ? item.accidentForm_dictText : '/'}}</view>
</view>
<view class="row">
<view class="label">事故类型</view>
<view class="val">{{item.accidentType_dictText ? item.accidentType_dictText : '/'}}</view>
</view>
<view class="row">
<view class="label">事故损失</view>
<view class="val">{{item.accidentLossType_dictText ? item.accidentLossType_dictText : '/'}}</view>
</view>
<view class="row">
<view class="label">需要更换配件</view>
<view class="val">{{item.replacedParts ? item.replacedParts : '/'}}</view>
</view>
<view class="row">
<view class="label">伤亡类型</view>
<view class="val">{{item.accidentInjuryType_dictText ? item.accidentInjuryType_dictText : '/'}}</view>
</view>
<view class="row">
<view class="label">初步预估责任</view>
<view class="val">{{item.liabilityEstimate_dictText ? item.liabilityEstimate_dictText : '/'}}</view>
</view>
<view class="row">
<view class="label">初步预估性质</view>
<view class="val">{{item.natureEstimate_dictText ? item.natureEstimate_dictText : '/'}}</view>
</view>
<view class="row">
<view class="label">事故现场图片</view>
<view class="pic-box">
<view
class="item"
wx:for="{{item.accidentScenePhotoList}}"
wx:key="index"
wx:for-item="pic"
wx:if="{{item.accidentScenePhotoList.length > 0}}"
data-index="{{index}}"
data-key="accidentScenePhotoList"
bindtap="previewImg">
<image src="{{pic}}" mode=""/>
</view>
<view class="val" wx:if="{{item.accidentScenePhotoList.length == 0}}">无</view>
</view>
</view>
<view class="row">
<view class="label">事故现场视频</view>
<view class="pic-box" style="max-width: 75%;">
<view
class="item"
wx:for="{{item.accidentSceneVideoList}}"
wx:key="index"
wx:for-item="pic"
wx:if="{{item.accidentSceneVideoList.length > 0}}"
data-index="{{index}}"
data-key="accidentSceneVideoList"
bindtap="previewVidoe">
<video src="{{pic}}" />
</view>
<view class="val" wx:if="{{item.accidentSceneVideoList.length == 0}}">无</view>
</view>
</view>
<view class="row">
<view class="label">保险公司现场勘察报告</view>
<view class="pic-box">
<view
class="item"
wx:for="{{item.insuranceInvestigationReportList}}"
wx:key="index"
wx:for-item="pic"
wx:if="{{item.insuranceInvestigationReportList.length > 0}}"
data-index="{{index}}"
data-key="insuranceInvestigationReportList"
bindtap="previewImg">
<image src="{{pic}}" mode=""/>
</view>
<view class="val" wx:if="{{item.insuranceInvestigationReportList.length == 0}}">无</view>
</view>
</view>
</view>
<view class="content" wx:if="{{tabActive == 1}}">
<view class="row">
<view class="label">交案回执单号</view>
<view class="val">{{item.accidentInsuranceInfo.caseReceiptNumber ? item.accidentInsuranceInfo.caseReceiptNumber : '/'}}</view>
</view>
<view class="row">
<view class="label">确定事故责任</view>
<view class="val">{{item.accidentInsuranceInfo.liabilityConfirm_dictText ? item.accidentInsuranceInfo.liabilityConfirm_dictText : '/'}}</view>
</view>
<view class="row">
<view class="label">确定事故性质</view>
<view class="val">{{item.accidentInsuranceInfo.natureConfirm_dictText ? item.accidentInsuranceInfo.natureConfirm_dictText : '/'}}</view>
</view>
<view class="row">
<view class="label">标的车损金额(元)</view>
<view class="val">{{item.accidentInsuranceInfo.vehicleLossAmount ? item.accidentInsuranceInfo.vehicleLossAmount : '/'}}</view>
</view>
<view class="row">
<view class="label">标的车人伤金额</view>
<view class="val">{{item.accidentInsuranceInfo.vehiclePersonalInjuryAmount ? item.accidentInsuranceInfo.vehiclePersonalInjuryAmount : '/'}}</view>
</view>
<view class="row">
<view class="label">第三方物损金额</view>
<view class="val">{{item.accidentInsuranceInfo.thirdPropertyDamageAmount ? item.accidentInsuranceInfo.thirdPropertyDamageAmount : '/'}}</view>
</view>
<view class="row">
<view class="label">第三方人损金额</view>
<view class="val">{{item.accidentInsuranceInfo.thirdPersonalInjuryAmount ? item.accidentInsuranceInfo.thirdPersonalInjuryAmount : '/'}}</view>
</view>
<view class="row">
<view class="label">预估损失总金额</view>
<view class="val">{{item.accidentInsuranceInfo.estimatedTotalLossAmount ? item.accidentInsuranceInfo.estimatedTotalLossAmount : '/'}}</view>
</view>
<view class="row">
<view class="label">理赔至公司账户日期</view>
<view class="val">{{item.accidentInsuranceInfo.claimToCompanyAccountDate ? item.accidentInsuranceInfo.claimToCompanyAccountDate : '/'}}</view>
</view>
<view class="row">
<view class="label">理赔至公司账户金额</view>
<view class="val">{{item.accidentInsuranceInfo.claimToCompanyAccountAmount ? item.accidentInsuranceInfo.claimToCompanyAccountAmount : '/'}}</view>
</view>
<view class="row">
<view class="label">理赔至第三方账户日期</view>
<view class="val">{{item.accidentInsuranceInfo.claimToCompanyAccountDate ? item.accidentInsuranceInfo.claimToCompanyAccountDate : '/'}}</view>
</view>
<view class="row">
<view class="label">理赔至第三方账户金额</view>
<view class="val">{{item.accidentInsuranceInfo.claimToThirdAccountAmount ? item.accidentInsuranceInfo.claimToThirdAccountAmount : '/'}}</view>
</view>
<view class="row">
<view class="label">出险理赔总金额</view>
<view class="val">{{item.accidentInsuranceInfo.totalCompensationAmount ? item.accidentInsuranceInfo.totalCompensationAmount : '/'}}</view>
</view>
<view class="row">
<view class="label">出险未理赔金额</view>
<view class="val">{{item.accidentInsuranceInfo.uncompensatedAmount ? item.accidentInsuranceInfo.uncompensatedAmount : '/'}}</view>
</view>
<view class="row">
<view class="label">案件实际发生总金额</view>
<view class="val">{{item.accidentInsuranceInfo.totalAmountActuallyIncurred ? item.accidentInsuranceInfo.totalAmountActuallyIncurred : '/'}}</view>
</view>
<view class="row">
<view class="label">理赔单据</view>
<view class="pic-box">
<view
class="item"
wx:for="{{item.accidentInsuranceInfo.documentImageList}}"
wx:key="index"
wx:for-item="pic"
wx:if="{{item.accidentInsuranceInfo.documentImageList.length > 0}}"
data-index="{{index}}"
data-key="accidentInsuranceInfo"
data-key2="documentImageList"
bindtap="previewImg">
<image src="{{pic}}" mode=""/>
</view>
<view class="val" wx:if="{{item.accidentInsuranceInfo.documentImageList.length == 0}}">无</view>
</view>
</view>
</view>
</view>
<view class="bottom">
<view class="btn-box">
<view class="btn" catch:tap="toFeedback">结案</view>
</view>
</view>
</view>
@@ -0,0 +1,8 @@
{
"usingComponents": {
"g-upload": "/components/uploadPic/uploadPic",
"van-popup": "@vant/weapp/popup/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index"
},
"navigationBarTitleText": "事故处理反馈"
}
@@ -0,0 +1,142 @@
/* pages/backlog/accidentFeedback/accidentFeedback.wxss */
.container {
height: 100vh;
padding-top: 2px;
box-sizing: border-box;
background: #EFF1F4;
overflow: hidden;
position: relative;
.content {
max-height: calc(100vh - 110px);
padding: 12px 8px 4px;
background: #fff;
border-radius: 0 0 8px 8px;
overflow-y: auto;
.row {
width: 100%;
min-height: 36px;
padding: 8px 10px;
margin-bottom: 8px;
box-sizing: border-box;
box-shadow: 0px 1px 0px 0px #E6EAF2;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
position: relative;
.label {
color: #2F3B50;
font-size: 14px;
}
.select {
width: 70%;
position: absolute;
right: 10px;
picker {
width: 100%;
text-align: right;
position: relative;
.picker {
width: 100%;
height: 38px;
padding-right: 20px;
box-sizing: border-box;
// border: 1px solid #E6EAF2;
border-radius: 4px;
font-size: 14px;
display: flex;
justify-content: flex-end;
align-items: center;
}
.picker::after {
content: '';
width: 0;
height: 0;
border-top: 6px solid #636B83;
border-right: 6px solid transparent;
border-bottom: 6px solid transparent;
border-left: 6px solid transparent;
position: absolute;
top: 50%;
right: 4px;
transform: translateY(-2px);
}
}
}
.date-select {
width: 70%;
padding-right: 20px;
text-align: right;
position: relative;
.arrow {
width: 0;
height: 0;
border-top: 6px solid #636B83;
border-right: 6px solid transparent;
border-bottom: 6px solid transparent;
border-left: 6px solid transparent;
position: absolute;
top: 50%;
right: 4px;
transform: translateY(-2px);
}
}
.marker {
width: 100%;
margin-top: 8px;
color: #949CB5;
font-size: 14px;
}
.upload {
width: 100%;
margin-top: 8px;
.upload-btn {
width: 64px;
height: 64px;
background: #ECF1FF;
border-radius: 4px;
border: 1px dashed #4381FC;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
image {
width: 20px;
height: 20px;
margin: 16rpx 0 8rpx;
}
.val {
color: #4381FC;
font-size: 14px;
}
}
}
}
}
.bottom {
width: 100%;
padding: 22px 10px;
background: #fff;
box-sizing: border-box;
border-radius: 8px 8px 0 0;
box-shadow: 0px -2px 12px 0px rgba(0,0,0,0.2);
position: absolute;
bottom: 0;
left: 0;
.btn-box {
width: 100%;
display: flex;
justify-content: space-between;
.btn {
width: 100%;
height: 40px;
line-height: 40px;
border-radius: 8px;
background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%);
color: #fff;
font-weight: bold;
text-align: center;
}
}
}
}
@@ -0,0 +1,211 @@
// pages/backlog/accidentFeedback/accidentFeedback.ts
import { putAction } from '../../../api/base';
const dayjs = require('dayjs');
Page({
/**
* 页面的初始数据
*/
data: {
detailInf: {} as any,
currentDate: new Date().getTime(),
dateTimeStr: '请选择时间',
options: [
{
name: '请选择',
type: ''
},
{
name: '是',
type: 1
},
{
name: '否',
type: 0
}
],
selectIndex: 0,
selectOption: {} as any,
marker: '',
photoList: {
accidentCertificatePhoto: [],
compensationAgreementPhoto: [],
lossAssessmentPhoto: [],
otherPhoto: []
} as any,
uploadUrl: 'api/vehicles/accidentInfo/upload'
},
bindPicker(e: any) {
console.log(e.detail.value);
let index = Number(e.detail.value);
this.setData({
selectIndex: index,
selectOption: this.data.options[index]
});
},
showDateTimePicker() {
this.setData({
show: true
});
},
dateOnInput(event: any) {
console.log(event.detail);
this.setData({
currentDate: event.detail,
dateTimeStr: dayjs(new Date(event.detail)).format('YYYY-MM-DD HH:mm'),
show: false
});
},
getMarker(e: any) {
this.setData({
marker: e.detail.value
});
},
onClose() {
this.setData({
show: false
});
},
returnPic(e: any) {
console.log(e.detail.photoList);
let urlList = [] as any;
e.detail.photoList.forEach((item: any) => {
urlList.push(item.fileUrl);
});
let tmp = this.data.photoList;
tmp[e.currentTarget.dataset.key] = urlList;
this.setData({
photoList: tmp
});
},
checkStr(str: string) {
let returnStr = '';
let spaceRegex = /^\S*$/;
let regex = /[!@#$%^&*?><|\\\\]/;
let tooLong = str.length > 32;
if (!spaceRegex.test(str)) {
returnStr = '不支持含有空格';
} else if (regex.test(str)) {
returnStr = '不支持特殊字符';
} else if (tooLong) {
returnStr = '输入长度不得超过32个字符';
} else {
returnStr = '';
}
return returnStr;
},
bindSend() {
let parms = this.data.detailInf;
parms.accidentProgress = Object.assign(parms.accidentProgress, {
accidentCertificatePhoto:
this.data.photoList.accidentCertificatePhoto.join(','),
compensationAgreementPhoto:
this.data.photoList.compensationAgreementPhoto.join(','),
lossAssessmentPhoto: this.data.photoList.lossAssessmentPhoto.join(','),
otherPhoto: this.data.photoList.otherPhoto.join(','),
remark: this.data.marker,
closingTime: this.data.dateTimeStr,
caseClosed: this.data.selectOption.type
});
if (this.data.selectIndex == 0) {
wx.showToast({
title: '请选择是否结案',
icon: 'none'
});
return;
}
if (parms.accidentProgress.closingTime == '请选择时间') {
wx.showToast({
title: '请选择结案时间',
icon: 'none'
});
return;
}
// 验证非必填
if (parms.accidentProgress.remark) {
let msg = this.checkStr(parms.accidentProgress.remark);
if (msg) {
wx.showToast({
title: '备注:' + msg,
icon: 'none'
});
return;
}
}
console.log(parms);
putAction('api/vehicles/accidentInfo/smallprogramEdit', parms).then(
(res: any) => {
if (res.code == 200) {
console.log(res.result);
// setTimeout(() => {
// wx.navigateBack({ delta: 2 });
// }, 1500);
wx.navigateTo({
url: '../backlogFeedback/backlogFeedback',
fail: e => {
console.log(e);
}
});
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
}
);
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
// 接收传参
const eventChannel = this.getOpenerEventChannel();
eventChannel &&
eventChannel.on &&
eventChannel.on('eventName', (data: any) => {
console.log('接收参数', data);
this.setData({
detailInf: data
});
});
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
});
@@ -0,0 +1,86 @@
<!--pages/backlog/accidentFeedback/accidentFeedback.wxml-->
<view class="container">
<view class="content">
<view class="row">
<view class="label">是否结案</view>
<view class="select">
<picker bindchange="bindPicker" value="{{selectIndex}}" range-key="name" range="{{options}}">
<view class="picker project-select">
{{options[selectIndex].name}}
</view>
</picker>
</view>
</view>
<view class="row">
<view class="label">结案时间</view>
<view class="date-select" catch:tap="showDateTimePicker">
{{ dateTimeStr }}
<view class="arrow"></view>
</view>
</view>
<view class="row">
<view class="label">备注</view>
<view class="marker">
<textarea type="text"
placeholder="请输入备注"
style="height: 96rpx;"
placeholder-style="color: #949CB5; font-size: 28rpx; font-weight: 400;"
value="{{marker}}"
bindinput="getMarker"/>
</view>
</view>
<view class="row">
<view class="label">事故认定书</view>
<view class="upload">
<g-upload
maxLength="{{10}}"
uploadUrl="{{uploadUrl}}"
data-key="accidentCertificatePhoto"
bind:returnPic="returnPic"></g-upload>
</view>
</view>
<view class="row">
<view class="label">赔偿协议书</view>
<view class="upload">
<g-upload
maxLength="{{10}}"
uploadUrl="{{uploadUrl}}"
data-key="compensationAgreementPhoto"
bind:returnPic="returnPic"></g-upload>
</view>
</view>
<view class="row">
<view class="label">定损单</view>
<view class="upload">
<g-upload
maxLength="{{10}}"
uploadUrl="{{uploadUrl}}"
data-key="lossAssessmentPhoto"
bind:returnPic="returnPic"></g-upload>
</view>
</view>
<view class="row">
<view class="label">其他定损理赔资料</view>
<view class="upload">
<g-upload
maxLength="{{10}}"
uploadUrl="{{uploadUrl}}"
data-key="otherPhoto"
bind:returnPic="returnPic"></g-upload>
</view>
</view>
</view>
<view class="bottom">
<view class="btn-box">
<view class="btn" catch:tap="bindSend">已处理</view>
</view>
</view>
<van-popup show="{{ show }}" position="bottom" bind:close="onClose">
<van-datetime-picker
type="datetime"
value="{{ currentDate }}"
bind:confirm="dateOnInput"
bind:cancel="onClose"
/>
</van-popup>
</view>
@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "年检提醒详情"
}
@@ -0,0 +1,207 @@
/* pages/backlog/annualInspection/annualInspection.wxss */
.container {
height: 100vh;
padding-top: 2px;
box-sizing: border-box;
background: #EFF1F4;
overflow: hidden;
position: relative;
.bg {
width: 100%;
height: 250px;
position: absolute;
top: 0;
image {
width: 100%;
height: 100%;
display: block;
}
}
.top {
margin: 8px 8px 10px;
padding: 12px 10px;
margin-bottom: 8px;
background: #fff;
border-radius: 8px;
position: relative;
.row:first-child {
margin-bottom: 8px;
}
.row {
color: #2E3A4F;
display: flex;
justify-content: space-between;
align-items: center;
.number-plate {
display: flex;
.status {
padding: 0 6px;
margin-right: 4px;
border-radius: 2px;
color: #FFFFFF;
font-size: 14px;
}
.status1 {
background: linear-gradient(90deg, #0D92FF 0%, #38B1FE 100%);
}
.status2 {
background: linear-gradient(270deg, #4CDBAD 0%, #2FCBAB 100%);
}
.status3 {
background: linear-gradient(270deg, #A1A8BB 0%, #838EAA 100%);
}
.val {
font-size: 16px;
font-weight: bold;
}
}
.project-name, .code {
font-size: 14px;
}
.time {
font-size: 14px;
color: #858CA0;
}
.type-list {
display: flex;
.type {
height: 22px;
line-height: 22px;
padding: 0 8px;
margin-left: 5px;
background: #FFF1F0;
border-radius: 4px;
border: 1px solid #FFA39E;
color: #FF4D4F;
font-size: 12px;
}
.color-red {
color: #FF4D4F;
}
}
}
}
.detail-container {
max-height: calc(100vh - 72px);
box-sizing: border-box;
padding: 0px 8px 0px;
overflow: hidden;
position: relative;
.tabs {
display: flex;
.tab {
width: 50%;
height: 40px;
line-height: 40px;
// background: #fff;
border-radius: 8px 8px 0 0;
color: #4381FC;
font-size: 16px;
font-weight: 500;
text-align: center;
position: relative;
.bg {
width: 100%;
height: 100%;
position: absolute;
image {
width: 100%;
height: 100%;
display: block;
}
}
.value {
position: relative;
}
}
.active::after {
content: '';
width: 26px;
height: 4px;
background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%);
border-radius: 2px;
position: absolute;
bottom: 2px;
left: 50%;
transform: translateX(-50%);
}
}
.content-borderall {
border-radius: 8px;
}
.content {
max-height: calc(100vh - 72px - 40px - 100px);
padding: 12px 10px;
box-sizing: border-box;
border-radius: 0px 8px 8px 8px;
background: #fff;
overflow-y: auto;
.line {
width: 100%;
height: 1px;
margin-bottom: 8px;
background: #EFEFEF;
}
.row {
margin-bottom: 8px;
display: flex;
justify-content: space-between;
// align-items: center;
.label {
margin-right: 4px;
color: #858CA0;
font-size: 14px;
white-space: nowrap;
}
.val {
color: #2E3A4F;
font-size: 14px;
}
.pic-box {
max-width: 70%;
display: flex;
justify-content: flex-end;
flex-wrap: wrap;
.item {
width: 84px;
height: 84px;
padding-left: 8px;
display: flex;
align-items: center;
image {
width: 100%;
height: 100%;
display: block;
}
}
}
}
}
}
.bottom {
width: 100%;
padding: 10px 8px 30px;
background: #fff;
box-sizing: border-box;
border-radius: 8px 8px 0 0;
box-shadow: 0px -2px 12px 0px rgba(0,0,0,0.2);
position: absolute;
bottom: 0;
left: 0;
.btn-box {
width: 100%;
display: flex;
justify-content: space-between;
.btn {
width: 100%;
height: 40px;
line-height: 40px;
border-radius: 8px;
background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%);
color: #fff;
font-weight: bold;
text-align: center;
}
}
}
}
@@ -0,0 +1,130 @@
// pages/backlog/annualInspection/annualInspection.ts
import { getAction } from '../../../api/base';
Page({
/**
* 页面的初始数据
*/
data: {
tabActive: 0,
id: '',
item: {} as any
},
// 变更tab
changeTab(e: any) {
console.log(e.currentTarget.dataset.tab);
this.setData({
tabActive: e.currentTarget.dataset.tab
});
},
getDetailInf() {
let parms = {
id: this.data.id
};
getAction('api/vehicles/backlog/getAnnualInspectionById', parms).then(
(res: any) => {
if (res.code == 200) {
console.log(res.result);
res.result.drivingLicenseList = res.result.drivingLicense
? res.result.drivingLicense.split(',')
: [];
res.result.vehicleQualificationMarkList = res.result
.vehicleQualificationMark
? res.result.vehicleQualificationMark.split(',')
: [];
res.result.detailsTableList = res.result.detailsTable
? res.result.detailsTable.split(',')
: [];
res.result.otherList = res.result.other
? res.result.other.split(',')
: [];
this.setData({
item: res.result
});
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
}
);
},
previewImg(e: any) {
let that = this;
let { index, key, key2 } = e.currentTarget.dataset;
if (key2) {
wx.previewImage({
current: that.data.item[key][key2][index | 0], // 当前显示图片的http链接 默认urls[0]
urls: that.data.item[key][key2] // 需要预览的图片http链接列表
});
} else {
wx.previewImage({
current: that.data.item[key][index | 0], // 当前显示图片的http链接 默认urls[0]
urls: that.data.item[key] // 需要预览的图片http链接列表
});
}
},
toFeedback() {
let that = this;
// 跳转到反馈
wx.navigateTo({
url: '../annualInspectionFeedback/annualInspectionFeedback',
success: function (res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('eventName', { ...that.data.item });
},
fail: e => {
console.log(e);
}
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
const eventChannel = this.getOpenerEventChannel();
getApp().EventChannel = eventChannel;
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
let id = wx.getStorageSync('backlogInf').id;
this.setData({
id: id
});
this.getDetailInf();
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
});
@@ -0,0 +1,144 @@
<!--pages/backlog/annualInspection/annualInspection.wxml-->
<view class="container">
<view class="bg">
<image src="../../../images/bg_page_blue.png" mode=""/>
</view>
<view class="top">
<view class="row">
<view class="number-plate">
<view class="val">{{item.plateNumber}}</view>
</view>
<view class="project-name">{{item.projectId_dictText}}</view>
</view>
<view class="row">
<view class="time">年检有效期: {{item.validityPeriod ? item.validityPeriod : '-'}}</view>
<view class="type-list">
<view class="color-red">
{{item.overdueType ? item.overdueType : '已逾期'}}{{(item.overdueDays ? item.overdueDays : item.daysToOverdue)}}天
</view>
</view>
</view>
</view>
<view class="detail-container" wx:if="{{false}}">
<view class="tabs">
<view class="tab {{tabActive == 0 ? 'active' : ''}}" data-tab="0" catch:tap="changeTab">
<view class="bg"><image src="../../../images/btn_l.png" mode=""/></view>
<view class="value">年检信息</view>
</view>
<!-- <view class="tab {{tabActive == 1 ? 'active' : ''}}" data-tab="1" catch:tap="changeTab">报价信息</view> -->
</view>
<view class="content">
<view class="row">
<view class="label">处理人</view>
<view class="val">{{ item.processedPerson ? item.processedPerson : '/'}}</view>
</view>
<view class="row">
<view class="label">年检有效期</view>
<view class="val"> {{ item.validityPeriod ? item.validityPeriod : '/'}}</view>
</view>
<view class="row">
<view class="label">办理日期</view>
<view class="val">{{ item.handlingDate ? item.handlingDate : '/'}}</view>
</view>
<view class="row">
<view class="label">年检地点</view>
<view class="val">{{ item.location ? item.location : '/'}}天</view>
</view>
<view class="row">
<view class="label">备注</view>
<view class="val">{{ item.remark ? item.remark : '/'}}</view>
</view>
<view class="line"></view>
<view class="row">
<view class="label">检测费</view>
<view class="val">{{ item.testingFee ? item.testingFee : '/'}}</view>
</view>
<view class="row">
<view class="label">手续费</view>
<view class="val">{{ item.serviceFee ? item.serviceFee : '/'}}</view>
</view>
<view class="row">
<view class="label">杂费</view>
<view class="val">{{ item.miscellaneousFee ? item.miscellaneousFee : '/'}}</view>
</view>
<view class="row">
<view class="label">费用合计</view>
<view class="val">{{ item.totalFee ? item.totalFee : '/'}}</view>
</view>
<view class="line"></view>
<view class="row">
<view class="label">行驶证</view>
<view class="pic-box">
<view
class="item"
wx:for="{{item.drivingLicenseList}}"
wx:key="index"
wx:for-item="pic"
wx:if="{{item.drivingLicenseList.length > 0}}"
data-index="{{index}}"
data-key="drivingLicenseList"
bindtap="previewImg">
<image src="{{pic}}" mode=""/>
</view>
<view class="val" wx:if="{{item.drivingLicenseList.length == 0}}">/</view>
</view>
</view>
<view class="row">
<view class="label">车辆合格证</view>
<view class="pic-box">
<view
class="item"
wx:for="{{item.vehicleQualificationMarkList}}"
wx:key="index"
wx:for-item="pic"
wx:if="{{item.vehicleQualificationMarkList.length > 0}}"
data-index="{{index}}"
data-key="vehicleQualificationMarkList"
bindtap="previewImg">
<image src="{{pic}}" mode=""/>
</view>
<view class="val" wx:if="{{item.vehicleQualificationMarkList.length == 0}}">/</view>
</view>
</view>
<view class="row">
<view class="label">年检费用明细表</view>
<view class="pic-box">
<view
class="item"
wx:for="{{item.detailsTableList}}"
wx:key="index"
wx:for-item="pic"
wx:if="{{item.detailsTableList.length > 0}}"
data-index="{{index}}"
data-key="detailsTableList"
bindtap="previewImg">
<image src="{{pic}}" mode=""/>
</view>
<view class="val" wx:if="{{item.detailsTableList.length == 0}}">/</view>
</view>
</view>
<view class="row">
<view class="label">其他</view>
<view class="pic-box">
<view
class="item"
wx:for="{{item.otherList}}"
wx:key="index"
wx:for-item="pic"
wx:if="{{item.otherList.length > 0}}"
data-index="{{index}}"
data-key="otherList"
bindtap="previewImg">
<image src="{{pic}}" mode=""/>
</view>
<view class="val" wx:if="{{item.otherList.length == 0}}">/</view>
</view>
</view>
</view>
</view>
<view class="bottom">
<view class="btn-box">
<view class="btn" catch:tap="toFeedback">办理年检</view>
</view>
</view>
</view>
@@ -0,0 +1,11 @@
{
"usingComponents": {
"van-picker": "@vant/weapp/picker/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-popup": "@vant/weapp/popup/index",
"van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index",
"van-uploader": "@vant/weapp/uploader/index"
},
"navigationBarTitleText": "办理年检"
}
@@ -0,0 +1,367 @@
/* pages/backlog/annualInspectionFeedback/annualInspectionFeedback.wxss */
page {
height: 100vh;
background: #EFF1F4;
// overflow: hidden;
position: relative;
.container {
height: calc(100% - 88px);
overflow-y: auto;
.content {
background-color: #ffffff;
font-size: 28rpx;
padding: 28rpx 20rpx 0;
margin-bottom: 16rpx;
.top {
color: #333F53;
font-size: 14px;
display: flex;
align-items: center;
justify-content: space-between;
.left {
display: flex;
align-items: center;
.line {
width: 8rpx;
height: 44rpx;
background: linear-gradient(180deg, #4E87FC 0%, #38B1FE 100%);
border-radius: 4rpx;
margin-right: 16rpx;
}
.title {
color: #2E3A4F;
font-weight: bold;
}
}
.right {
display: flex;
.btn-add {
padding: 8px 12px;
margin-right: 8px;
background: #E9F2FF;
border-radius: 4px;
border: 1px dashed #4381FC;
color: #4381FC;
display: flex;
align-items: center;
image {
width: 36rpx;
height: 36rpx;
margin-right: 8px;
}
}
.btn-re {
padding: 8px 12px;
margin-right: 8px;
border-radius: 4px;
border: 1px solid #D6D6D6;
color: #2E3D52;
display: flex;
align-items: center;
image {
width: 18px;
height: 18px;
margin-right: 6px;
display: block;
}
.val {}
}
.btn {
display: flex;
align-items: center;
image {
width: 18px;
height: 18px;
margin-right: 6px;
display: block;
}
.val {}
}
}
}
.box {
// padding: 10px 0 0;
.row {
// margin-bottom: 8px;
padding: 10px 8px;
border-bottom: 1px solid #E6EAF2;
color: #333F53;
font-size: 14px;
.flex-between {
justify-content: space-between;
}
.noalign-center {
align-items: flex-start !important;
}
>view {
display: flex;
align-items: center;
.left {
color: #858CA0;
display: flex;
line-height: 1.4rem;
.require {
color: #EA4955;
}
.title {
color: #2E3A4F;
font-size: 16px;
font-weight: bold;
}
}
.right {
max-width: 70%;
min-width: 50%;
text-align: right;
.upload-box {
width: 80px;
height: 80px;
background: #ECF1FF;
border-radius: 4px;
border: 1px dashed #4381FC;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
image {
width: 20px;
height: 20px;
margin: 16rpx 0 8rpx;
}
.val {
color: #4381FC;
font-size: 14px;
}
}
image {
width: 84px;
height: 84px;
display: inline-block;
margin-left: 6px;
}
.select-box {
width: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
.placeholder {
color: #949CB5;
}
.arrow {
width: 0;
height: 0;
border-left: 13rpx solid transparent;
border-right: 13rpx solid transparent;
border-top: 15rpx solid #636B83;
margin-left: 18rpx;
}
}
.input-box {
width: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
input {
flex: 1;
}
.unit {
margin-left: 4px;
color: #636B83;
font-size: 12px;
}
.clear-btn {
width: 12px;
height: 12px;
margin: 0 4px;
image {
width: 100%;
height: 100%;
display: block;
}
}
}
.address-box {
width: 100%;
display: flex;
align-items: center;
.val {
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.icon {
width: 14px;
height: 14px;
image {
width: 100%;
height: 100%;
margin-left: 2px;
display: block;
}
}
}
.tips {
color: #EA4955;
text-align: right;
}
}
}
}
.row:last-child {
margin-bottom: 0;
border-bottom: 0;
}
.row-w {
margin-bottom: 0;
background: #fff;
padding: 10px 12px;
border-bottom: 1px solid #E6EAF2;
.left,
.right {
color: #2F3B50 !important;
}
}
.row-w:first-child {
border-radius: 4px 4px 0px 0px;
}
.row:last-child {
border-radius: 0px 0px 4px 4px;
}
.row-nowarp {
flex-wrap: wrap;
.left {
width: 100%;
margin-bottom: 8px;
}
.right {
width: 100% !important;
max-width: 100% !important;
text-align-last: left;
}
}
.box-g {
padding: 12px;
margin-bottom: 8px;
background: #ECEFF5;
border-radius: 4px;
}
.box-g:last-child {
margin-bottom: 0;
}
.btn-box {
margin-top: 8px;
display: flex;
justify-content: center;
align-items: center;
.btn-del {
padding: 2px 16px;
background: #FFEEEE;
border-radius: 4px;
border: 1px solid #FDD0DD;
color: #FA5955;
}
}
}
}
}
.bottom {
width: 100%;
padding: 16px 12px 30px;
background: #fff;
box-sizing: border-box;
border-radius: 8px 8px 0 0;
box-shadow: 0px -2px 12px 0px rgba(0, 0, 0, 0.2);
position: absolute;
bottom: 0;
left: 0;
.btn-box {
width: 100%;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.btn {
width: 100%;
height: 40px;
line-height: 40px;
border-radius: 8px;
background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%);
color: #fff;
font-size: 30rpx;
font-weight: bold;
text-align: center;
}
.btn1,
.btn2 {
width: calc((100% - 12px) / 2);
}
.btn1 {
background: #fff;
border: 1px solid #d6d6d6;
box-sizing: border-box;
color: #2E3A4F;
}
}
}
}
.van-uploader__preview-delete {
.van-uploader__preview-delete-icon {
transform: scale(.7) translate(0,0);
}
}
.van-uploader__preview-delete:after {
background-color: #F56B6B !important;
border-top-left-radius: 12px !important;
border-top-right-radius: 12px !important;
border-bottom-right-radius: 12px !important;
border-bottom-left-radius: 12px !important;
}
@@ -0,0 +1,589 @@
// pages/backlog/annualInspectionFeedback/annualInspectionFeedback.ts
import { getAction, upload, putAction, postAction } from '../../../api/base';
const dayjs = require('dayjs');
Page({
/**
* 页面的初始数据
*/
data: {
showBox: {
base: true,
vehicle: true,
cost: true,
check: true
},
showSelect: {
projectSelectShow: false,
contractSelectShow: false,
vehicleTypeSelectShow: false,
templateSelectShow: false,
yesOrNoSelectShow: false,
timeSelectShow: false
} as any,
vehicleOptionsList: [],
vehiclePickerIndex: -1,
insuranceCompanyList: [],
insuranceCompanyPickerIndex: -1,
handleStatusOptions: [],
handleStatusIndex: -1,
yesOrNoOptions: [
{
text: '已处理',
value: 1
},
{
text: '未处理',
value: 0
}
],
requireObj: {
processedPerson: '',
validityPeriod: '',
testingFee: '',
serviceFee: '',
miscellaneousFee: ''
},
params: {
drivingLicense: '',
drivingLicenseList: [],
detailsTable: '',
detailsTableList: [],
vehicleQualificationMark: '',
vehicleQualificationMarkList: [],
other: '',
otherList: []
} as any,
changeProjectIndex: -1,
validityPeriodDateTamp: new Date().getTime(),
handlingDateTamp: new Date().getTime()
},
showBoxInf(e: any) {
console.log(e);
let data: any = { ...this.data };
let { fieldname } = e.currentTarget.dataset;
// let detail = e.detail;
data.showBox[fieldname] = !data.showBox[fieldname];
this.setData(data);
},
pickerChange(event: any) {
//下拉框切换是否展示
let fieldName: any = event.currentTarget.dataset.fieldname;
let data: any = { ...this.data };
if (fieldName == 'yesOrNoSelectShow') {
let { fieldindex } = event.currentTarget.dataset;
data.changeProjectIndex = fieldindex;
}
data.showSelect[fieldName] = true;
this.setData(data);
},
hidePicker() {
let showSelect = this.data.showSelect;
showSelect = {
projectSelectShow: false,
contractSelectShow: false,
vehicleTypeSelectShow: false,
templateSelectShow: false,
yesOrNoSelectShow: false,
timeSelectShow: false
};
this.setData({
showSelect: showSelect
});
},
pickerConfirm(event: any) {
console.log(event);
//下拉框点击确认
let { fieldname, fieldindex } = event.currentTarget.dataset;
let detail = event.detail;
let data: any = { ...this.data };
if (fieldname === 'vehicleId') {
data.params[fieldname] = detail.value.value;
data[fieldindex] = detail.index;
data.params.projectId = data.vehicleOptionsList[detail.index].projectId;
data.params.projectId_dictText =
data.vehicleOptionsList[detail.index].projectId_dictText;
} else if (fieldname === 'handlingDate') {
console.log(data.params.projectList);
data.params[fieldname] = dayjs(new Date(detail)).format('YYYY-MM-DD');
// data[fieldindex] = detail.index;
data.handlingDateTamp = detail;
console.log(data.params.projectList);
} else if (fieldname === 'validityPeriod') {
data.params[fieldname] = dayjs(new Date(detail)).format('YYYY-MM-DD');
// data[fieldindex] = detail.index;
data.validityPeriodDateTamp = detail;
console.log(data.params[fieldname]);
} else {
data.params[fieldname] = detail.value.value;
data[fieldindex] = detail.index;
}
if (data.params[fieldname]) {
// delete data.requireObj[fieldname];
data.requireObj[fieldname] = '';
} else {
data.requireObj[fieldname] = '请填写';
}
console.log(this.data);
this.setData(data);
this.hidePicker();
},
getVehicleOptions() {
let parms = {
plateNumber: ''
};
getAction('api/monitor/vehicle/listByAll', parms).then((res: any) => {
if (res.code == 200) {
let arr = [] as any;
res.result.forEach((item: any, index: number) => {
arr.push({
text: item.plateNumber,
value: item.id,
projectId: item.projectId,
projectId_dictText: item.projectId_dictText
});
if (
this.data.params.vehicleId != '' &&
this.data.params.vehicleId == item.id
) {
this.setData({
vehiclePickerIndex: index
});
}
});
this.setData({
vehicleOptionsList: arr
});
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
});
},
getInsuranceCompanyOptions() {
getAction('api/base/insuranceCompany/insuranceCompanyList').then(
(res: any) => {
if (res.code == 200) {
let arr = [] as any;
res.result.forEach((item: any, index: number) => {
arr.push({
text: item.name,
value: item.id
});
if (
this.data.params.insuranceCompanyId != '' &&
this.data.params.insuranceCompanyId == item.id
) {
this.setData({
insuranceCompanyPickerIndex: index
});
}
});
this.setData({
insuranceCompanyList: arr
});
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
}
);
},
getDictOptions(dictCode: string) {
getAction('api/sys/dict/getDictItems/' + dictCode).then((res: any) => {
if (res.code == 200) {
if (dictCode == 'contract_type') {
this.setData({
contractList: res.result,
contractPickerIndex: -1
});
if (this.data.params.contractId != '') {
let i = res.result.findIndex(
(x: any) => x.value == this.data.params.contractId
);
this.setData({
contractPickerIndex: i
});
}
} else if (dictCode == 'vehicle_type') {
this.setData({
vehicleTypeOptions: res.result,
vehicleTypeIndex: -1
// checkStatus: res.result[0]
});
if (this.data.params.vehicleType != '') {
let i = res.result.findIndex(
(x: any) => x.value == this.data.params.vehicleType
);
this.setData({
vehicleTypeIndex: i
});
}
} else {
}
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
});
},
checkStatusOnChange(e: any) {
let index = e.currentTarget.dataset.pindex;
let data: any = { ...this.data };
data.params.projectList[index].checkStatus = e.detail;
this.setData(data);
},
getInput(e: any) {
console.log(e);
let { fieldname, fieldindex, fieldkey } = e.currentTarget.dataset;
let detail = e.detail;
let data: any = { ...this.data };
if (
fieldname == 'testingFee' ||
fieldname == 'serviceFee' ||
fieldname == 'miscellaneousFee'
) {
let regex = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/;
data.params[fieldname] = detail.value;
let total = 0;
if (regex.test(data.params.testingFee)) {
// data.params[fieldname] = 0
total += Number(data.params.testingFee);
data.requireObj.testingFee = '';
} else {
data.requireObj.testingFee = '理赔金额为正数且最多保留两位小数';
}
if (regex.test(data.params.serviceFee)) {
// data.params[fieldname] = 0
total += Number(data.params.serviceFee);
data.requireObj.serviceFee = '';
} else {
data.requireObj.serviceFee = '理赔金额为正数且最多保留两位小数';
}
if (regex.test(data.params.miscellaneousFee)) {
// data.params[fieldname] = 0
total += Number(data.params.miscellaneousFee);
data.requireObj.miscellaneousFee = '';
} else {
data.requireObj.miscellaneousFee = '理赔金额为正数且最多保留两位小数';
}
data.params.totalFee = total;
} else if (fieldname == 'vehicleList') {
data.params[fieldname][fieldindex][fieldkey] = detail.value;
} else {
data.params[fieldname] = detail.value;
}
if (fieldname == 'processedPerson') {
if (data.params[fieldname]) {
// delete data.requireObj[fieldname];
data.requireObj[fieldname] = '';
} else {
data.requireObj[fieldname] = '请填写';
}
}
this.setData(data);
},
clearVal(e: any) {
let { fieldname, fieldindex, fieldkey } = e.currentTarget.dataset;
let data: any = { ...this.data };
if (fieldname == 'projectList') {
data.params.projectList[fieldindex].remark = '';
} else if (fieldname == 'vehicleList') {
data.params[fieldname][fieldindex][fieldkey] = '';
} else {
data.params[fieldname] = '';
}
this.setData(data);
},
addRow(e: any) {
console.log(123);
let { fieldname } = e.currentTarget.dataset;
let data: any = { ...this.data };
if (fieldname == 'vehicleList') {
data.params[fieldname].push({
vehicleNo: '',
frameNumber: ''
});
data.requireObj[fieldname].push({
vehicleNo: '',
frameNumber: ''
});
}
this.setData(data);
},
delRow(e: any) {
let { fieldname, fieldindex } = e.currentTarget.dataset;
let data: any = { ...this.data };
if (fieldname == 'vehicleList') {
let arr = data.params[fieldname],
value = data.params[fieldname][fieldindex];
let newSet = new Set(arr);
newSet.delete(value);
let newArr = [...newSet];
data.params[fieldname] = newArr;
let arr2 = data.requireObj[fieldname],
value2 = data.requireObj[fieldname][fieldindex];
let newSet2 = new Set(arr2);
newSet.delete(value2);
let newArr2 = [...newSet2];
data.requireObj[fieldname] = newArr2;
}
this.setData(data);
console.log(data);
},
radioOnChange(e: any) {
console.log(e);
let { fieldname } = e.currentTarget.dataset;
let data: any = { ...this.data };
data.params[fieldname] = e.detail;
this.setData(data);
},
// 上传
afterRead(e: any) {
console.log(e);
let { fieldname } = e.currentTarget.dataset;
const file = e.detail;
let option = {
name: 'file',
filePath: e.detail.file.url
};
upload('api/vehicles/repair/fileUpload', option).then((res: any) => {
let tempData = JSON.parse(res.data);
if (tempData.code == 200) {
let otherPhotoFile: any = this.data.params[fieldname + 'List'];
otherPhotoFile.push({ ...file, url: tempData.result.fileUrl });
let data: any = this.data;
let urls = '';
otherPhotoFile.forEach((p: any) => {
urls += p.url + ',';
});
urls = urls.slice(0, -1);
data.params[fieldname] = urls;
data.params[fieldname + 'List'] = otherPhotoFile;
console.log(data.params);
this.setData(data);
} else {
wx.showToast({
title: '上传失败,请重试',
icon: 'none'
});
}
});
},
deletePhoto(e: any) {
let { fieldname } = e.currentTarget.dataset;
let otherPhotoFile = this.data.params[fieldname + 'List'];
let index = e.detail.index;
otherPhotoFile.splice(index, 1);
let data: any = this.data;
let urls = '';
otherPhotoFile.forEach((p: any) => {
urls += p.url + ',';
});
urls = urls.slice(0, -1);
data.params[fieldname] = urls;
data.params[fieldname + 'List'] = otherPhotoFile;
this.setData(data);
},
isStepReady() {
//校验基础信息
let isAllReady = true;
let temp: any = this.data.requireObj;
let params: any = this.data.params;
for (let key in temp) {
if (key == 'id') {
continue;
}
if (key == 'vehicleList') {
params[key].forEach((item: any, index: number) => {
if (item.vehicleNo == '') {
isAllReady = false;
temp[key][index].vehicleNo = '请填写';
}
if (item.frameNumber == '') {
isAllReady = false;
temp[key][index].frameNumber = '请填写';
}
});
} else if (key == 'insuranceDate') {
let timeRegex =
/^(?:19|20)[0-9][0-9]-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:[0-2][1-9])|(?:[1-3][0-1])) (?:(?:[0-2][0-3])|(?:[0-1][0-9])):[0-5][0-9]$/;
if (!timeRegex.test(params[key])) {
isAllReady = false;
temp[key] = '请填写正确的时间';
}
// temp[key] = temp[key] ? temp[key] : '请填写正确的时间';
} else if (
key == 'testingFee' ||
key == 'serviceFee' ||
key == 'miscellaneousFee'
) {
// 判断是否是正整数
let regPos = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/;
console.log(!regPos.test(params[key]));
if (!regPos.test(params[key])) {
isAllReady = false;
temp[key] = '理赔金额为正数且最多保留两位小数';
}
if (params[key] > 99999999) {
isAllReady = false;
temp[key] = '费用金额上限为99999999';
}
} else if (params[key] === '') {
isAllReady = false;
temp[key] = temp[key] ? temp[key] : '请填写';
} else {
temp[key] = '';
}
}
this.setData({
requireObj: temp
});
console.log(temp, isAllReady);
return isAllReady;
},
formSubmit() {
if (!this.isStepReady()) {
wx.showToast({
title: '请填写完整对应信息',
icon: 'none'
});
// 验证是否非空
return;
}
wx.showLoading({
title: '保存中'
});
putAction('api/vehicles/annualInspectionInfo/add', this.data.params).then(
(res: any) => {
wx.hideLoading();
if (res.code == 200) {
wx.showToast({
title: '保存成功',
icon: 'success'
});
wx.navigateTo({
url: '../backlogFeedback/backlogFeedback',
fail: e => {
console.log(e);
}
});
// setTimeout(() => {
// wx.navigateBack({
// delta: 2
// });
// }, 500);
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
}
);
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
this.getVehicleOptions();
this.getInsuranceCompanyOptions();
// // 接收传参
const eventChannel = this.getOpenerEventChannel();
eventChannel &&
eventChannel.on &&
eventChannel.on('eventName', data => {
console.log('接收参数', data);
data.drivingLicenseList = [];
if (data.drivingLicense) {
for (let i = 0; i < data.drivingLicense.split(',').length; i++) {
let pic = data.drivingLicense.split(',')[i];
data.drivingLicenseList.push({
url: pic,
name: ''
});
}
}
data.detailsTableList = [];
if (data.detailsTable) {
for (let i = 0; i < data.detailsTable.split(',').length; i++) {
let pic = data.detailsTable.split(',')[i];
data.detailsTableList.push({
url: pic,
name: ''
});
}
}
data.vehicleQualificationMarkList = [];
if (data.vehicleQualificationMark) {
for (
let i = 0;
i < data.vehicleQualificationMark.split(',').length;
i++
) {
let pic = data.vehicleQualificationMark.split(',')[i];
data.vehicleQualificationMarkList.push({
url: pic,
name: ''
});
}
}
data.otherList = [];
if (data.other) {
for (let i = 0; i < data.other.split(',').length; i++) {
let pic = data.other.split(',')[i];
data.otherList.push({
url: pic,
name: ''
});
}
}
this.setData({
params: data
});
// this.getDetail(data.id);
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
});
@@ -0,0 +1,321 @@
<!--pages/backlog/annualInspectionFeedback/annualInspectionFeedback.wxml-->
<view class="container">
<view class="content">
<view class="top">
<view class="left">
<view class="line"></view>
<view class="title">基本信息</view>
</view>
<view class="right">
<view class="btn" wx:if="{{showBox.base}}" data-fieldName="base" catch:tap="showBoxInf">
<image src="../../../images/icon_up.png" mode=""/>
<view class="val">收起</view>
</view>
<view class="btn" wx:if="{{!showBox.base}}" data-fieldName="base" catch:tap="showBoxInf">
<image src="../../../images/icon_down.png" mode=""/>
<view class="val">展开</view>
</view>
</view>
</view>
<view class="box" wx:if="{{showBox.base}}">
<view class="row">
<view class="flex-between">
<view class="left">
<view class="title">{{params.plateNumber ? params.plateNumber : '/'}}</view>
</view>
<view class="right">
{{params.projectId_dictText ? params.projectId_dictText : '/'}}
<!-- <view class="select-box" data-fieldName="vehicleSelectShow" catch:tap="pickerChange">
<view wx:if="{{params.vehicleId}}">{{vehicleOptionsList[vehiclePickerIndex].text}}</view >
<view class="placeholder" wx:else>请选择</view>
<view class="arrow"></view>
</view>
<view class="tips" wx:if="{{requireObj.vehicleId != ''}}">{{requireObj.vehicleId}}</view> -->
</view>
</view>
<!-- 项目下拉选择 -->
<van-popup show="{{showSelect.vehicleSelectShow}}" position="bottom" bind:close="hidePicker">
<van-picker data-fieldname="vehicleId" data-fieldindex="vehiclePickerIndex" show-toolbar
columns="{{vehicleOptionsList}}" bind:confirm="pickerConfirm" bind:cancel="hidePicker">
</van-picker>
</van-popup>
</view>
<view class="row">
<view class="flex-between">
<view class="left"><view class="require">*</view>处理人</view>
<view class="right">
<!-- {{params.projectId_dictText ? params.projectId_dictText : '/'}} -->
<view class="input-box">
<input value="{{params.processedPerson}}" placeholder="请输入" type="text" data-fieldName="processedPerson" bindinput="getInput" />
<view class="clear-btn" data-fieldName="processedPerson" catch:tap="clearVal">
<image src="../../../images/icon_delete.png" mode=""/>
</view>
</view>
<view class="tips" wx:if="{{requireObj.processedPerson != ''}}">{{requireObj.processedPerson}}</view>
</view>
</view>
</view>
</view>
</view>
<view class="content">
<view class="top">
<view class="left">
<view class="line"></view>
<view class="title">年检信息</view>
</view>
<view class="right">
<view class="btn" wx:if="{{showBox.vehicle}}" data-fieldName="vehicle" catch:tap="showBoxInf">
<image src="../../../images/icon_up.png" mode=""/>
<view class="val">收起</view>
</view>
<view class="btn" wx:if="{{!showBox.vehicle}}" data-fieldName="vehicle" catch:tap="showBoxInf">
<image src="../../../images/icon_down.png" mode=""/>
<view class="val">展开</view>
</view>
</view>
</view>
<view class="box" wx:if="{{showBox.vehicle}}">
<view class="row">
<view class="flex-between">
<view class="left"><view class="require">*</view>年检有效期</view>
<view class="right">
<view class="select-box" data-fieldName="validityPeriodSelectShow" catch:tap="pickerChange">
<view wx:if="{{params.validityPeriod}}">{{params.validityPeriod}}</view>
<view class="placeholder" wx:else>请选择</view>
<view class="arrow"></view>
</view>
<view class="tips" wx:if="{{requireObj.validityPeriod != ''}}">{{requireObj.validityPeriod}}</view>
</view>
</view>
<van-popup show="{{showSelect.validityPeriodSelectShow}}" position="bottom" bind:close="hidePicker">
<van-datetime-picker type="date" value="{{ validityPeriodDateTamp }}" data-fieldName="validityPeriod" bind:cancel="hidePicker" bind:confirm="pickerConfirm" />
</van-popup>
</view>
<view class="row">
<view class="flex-between">
<view class="left">办理日期</view>
<view class="right">
<view class="select-box" data-fieldName="handlingDateSelectShow" catch:tap="pickerChange">
<view wx:if="{{params.handlingDate}}">{{params.handlingDate}}</view>
<view class="placeholder" wx:else>请选择</view>
<view class="arrow"></view>
</view>
<view class="tips" wx:if="{{requireObj.handlingDate != ''}}">{{requireObj.handlingDate}}</view>
</view>
</view>
<van-popup show="{{showSelect.handlingDateSelectShow}}" position="bottom" bind:close="hidePicker">
<van-datetime-picker type="date" value="{{ handlingDateTamp }}" data-fieldName="handlingDate" bind:cancel="hidePicker" bind:confirm="pickerConfirm" />
</van-popup>
</view>
<view class="row">
<view class="flex-between">
<view class="left">年检地点</view>
<view class="right">
<view class="input-box">
<input value="{{params.location}}" placeholder="请输入" type="text" data-fieldName="location" bindinput="getInput" />
<view class="clear-btn" data-fieldName="location" catch:tap="clearVal">
<image src="../../../images/icon_delete.png" mode=""/>
</view>
</view>
<view class="tips" wx:if="{{requireObj.location != ''}}">{{requireObj.location}}</view>
</view>
</view>
</view>
<view class="row">
<view class="flex-between">
<view class="left">备注</view>
<view class="right">
<view class="input-box">
<input value="{{params.remark}}" placeholder="请输入" type="text" data-fieldName="remark" bindinput="getInput" />
<view class="clear-btn" data-fieldName="remark" catch:tap="clearVal">
<image src="../../../images/icon_delete.png" mode=""/>
</view>
</view>
<view class="tips" wx:if="{{requireObj.remark != ''}}">{{requireObj.remark}}</view>
</view>
</view>
</view>
</view>
</view>
<view class="content">
<view class="top">
<view class="left">
<view class="line"></view>
<view class="title">年检费用</view>
</view>
<view class="right">
<view class="btn" wx:if="{{showBox.cost}}" data-fieldName="cost" catch:tap="showBoxInf">
<image src="../../../images/icon_up.png" mode=""/>
<view class="val">收起</view>
</view>
<view class="btn" wx:if="{{!showBox.cost}}" data-fieldName="cost" catch:tap="showBoxInf">
<image src="../../../images/icon_down.png" mode=""/>
<view class="val">展开</view>
</view>
</view>
</view>
<view class="box" wx:if="{{showBox.cost}}">
<view class="row">
<view class="flex-between noalign-center">
<view class="left"><view class="require">*</view>检测费</view>
<view class="right">
<view class="input-box">
<input value="{{params.testingFee}}" placeholder="请输入" type="digit" data-fieldName="testingFee" bindinput="getInput" />
<!-- <view class="clear-btn" data-fieldName="testingFee" catch:tap="clearVal">
<image src="../../../images/icon_delete.png" mode=""/>
</view> -->
<view class="unit">元</view>
</view>
<view class="tips" wx:if="{{requireObj.testingFee != ''}}">{{requireObj.testingFee}}</view>
</view>
</view>
</view>
<view class="row">
<view class="flex-between noalign-center">
<view class="left"><view class="require">*</view>手续费</view>
<view class="right">
<view class="input-box">
<input value="{{params.serviceFee}}" placeholder="请输入" type="digit" data-fieldName="serviceFee" bindinput="getInput" />
<!-- <view class="clear-btn" data-fieldName="serviceFee" catch:tap="clearVal">
<image src="../../../images/icon_delete.png" mode=""/>
</view> -->
<view class="unit">元</view>
</view>
<view class="tips" wx:if="{{requireObj.serviceFee != ''}}">{{requireObj.serviceFee}}</view>
</view>
</view>
</view>
<view class="row">
<view class="flex-between noalign-center">
<view class="left"><view class="require">*</view>杂费</view>
<view class="right">
<view class="input-box">
<input value="{{params.miscellaneousFee}}" placeholder="请输入" type="digit" data-fieldName="miscellaneousFee" bindinput="getInput" />
<!-- <view class="clear-btn" data-fieldName="miscellaneousFee" catch:tap="clearVal">
<image src="../../../images/icon_delete.png" mode=""/>
</view> -->
<view class="unit">元</view>
</view>
<view class="tips" wx:if="{{requireObj.miscellaneousFee != ''}}">{{requireObj.miscellaneousFee}}</view>
</view>
</view>
</view>
<view class="row">
<view class="flex-between">
<view class="left"><view class="require">*</view>费用合计</view>
<view class="right">
<view class="input-box">
<input value="{{params.totalFee}}" placeholder="自动计算" disabled="true" type="digit" data-fieldName="totalFee" bindinput="getInput" />
<!-- <view class="clear-btn" data-fieldName="totalFee" catch:tap="clearVal">
<image src="../../../images/icon_delete.png" mode=""/>
</view> -->
<view class="unit">元</view>
</view>
<view class="tips" wx:if="{{requireObj.totalFee != ''}}">{{requireObj.totalFee}}</view>
</view>
</view>
</view>
</view>
</view>
<view class="content">
<view class="top">
<view class="left">
<view class="line"></view>
<view class="title">附件上传</view>
</view>
<view class="right">
<view class="btn" wx:if="{{showBox.check}}" data-fieldName="check" catch:tap="showBoxInf">
<image src="../../../images/icon_up.png" mode=""/>
<view class="val">收起</view>
</view>
<view class="btn" wx:if="{{!showBox.check}}" data-fieldName="check" catch:tap="showBoxInf">
<image src="../../../images/icon_down.png" mode=""/>
<view class="val">展开</view>
</view>
</view>
</view>
<view class="box" wx:if="{{showBox.check}}">
<view class="row">
<view class="row-nowarp">
<view class="left">行驶证</view>
<view class="right">
<van-uploader
file-list="{{ params.drivingLicenseList }}"
deletable="{{ true }}"
max-count="10"
data-fieldName="drivingLicense"
bind:after-read="afterRead"
bind:delete="deletePhoto" >
<view class="upload-box">
<image src="../../../images/icon_upload.png" mode=""/>
<view class="val">上传图片</view>
</view>
</van-uploader>
</view>
</view>
</view>
<view class="row">
<view class="row-nowarp">
<view class="left">车辆合格证</view>
<view class="right">
<van-uploader
file-list="{{ params.detailsTableList }}"
deletable="{{ true }}"
max-count="10"
data-fieldName="detailsTable"
bind:after-read="afterRead"
bind:delete="deletePhoto" >
<view class="upload-box">
<image src="../../../images/icon_upload.png" mode=""/>
<view class="val">上传图片</view>
</view>
</van-uploader>
</view>
</view>
</view>
<view class="row">
<view class="row-nowarp">
<view class="left">年检费用明细表</view>
<view class="right">
<van-uploader
file-list="{{ params.vehicleQualificationMarkList }}"
deletable="{{ true }}"
max-count="10"
data-fieldName="vehicleQualificationMark"
bind:after-read="afterRead"
bind:delete="deletePhoto" >
<view class="upload-box">
<image src="../../../images/icon_upload.png" mode=""/>
<view class="val">上传图片</view>
</view>
</van-uploader>
</view>
</view>
</view>
<view class="row">
<view class="row-nowarp">
<view class="left">其他</view>
<view class="right">
<van-uploader
file-list="{{ params.otherList }}"
deletable="{{ true }}"
max-count="10"
data-fieldName="other"
bind:after-read="afterRead"
bind:delete="deletePhoto" >
<view class="upload-box">
<image src="../../../images/icon_upload.png" mode=""/>
<view class="val">上传图片</view>
</view>
</van-uploader>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="bottom">
<view class="btn-box">
<view class="btn" catch:tap="formSubmit">保存</view>
</view>
</view>
@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "已提交"
}
@@ -0,0 +1,108 @@
.container {
min-height: 100vh;
background: #EFF1F4;
.bg {
width: 100%;
height: 250px;
image {
width: 100%;
height: 100%;
display: block;
}
}
.sign-in-container {
width: calc(100% - 40px);
height: 90px;
margin: -120px auto 0;
border-radius: 8px;
position: relative;
.bg {
width: 100%;
height: 100%;
position: absolute;
image {
width: 100%;
height: 100%;
display: block;
}
}
.title {
position: absolute;
top: -114px;
left: 50%;
transform: translateX(-50%);
.icon {
width: 86px;
height: 70px;
image {
width: 100%;
height: 100%;
display: block;
}
}
.name {
margin-top: 8px;
color: #fff;
font-size: 20px;
}
}
.inf {
width: 100%;
padding: 24px 20px;
box-sizing: border-box;
position: relative;
.row {
width: 100%;
margin-bottom: 8px;
font-size: 14px;
display: flex;
// align-items: center;
.icon {
width: 14px;
height: 14px;
margin: 2px 0;
vertical-align: text-bottom;
image {
width: 100%;
height: 100%;
display: block;
}
}
.label {
margin: 0 8px 0 2px;
color: #9499AB;
white-space: nowrap;
}
.val {
color: #2E3A4F;
}
}
.btn-box {
width: calc(100% - 40px);
margin: 0px auto;
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
.btn {
width: 100%;
height: 40px;
line-height: 40px;
box-sizing: border-box;
border-radius: 4px;
font-size: 15px;
font-weight: bold;
text-align: center;
}
.btn-record {
color: #4381FC;
border: 1px solid #4381FC;
}
.btn-back {
background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%);
color: #fff;
}
}
}
}
}
@@ -0,0 +1,60 @@
// pages/backlog/backlogFeedback/backlogFeedback.ts
Page({
/**
* 页面的初始数据
*/
data: {},
comeBack() {
wx.navigateBack({
delta: 3,
success: function (res) {
// 通过eventChannel向被打开页面传送数据
getApp().EventChannel.emit('refresh');
},
fail: e => {
console.log(e);
}
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
this.comeBack();
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
});
@@ -0,0 +1,23 @@
<!--pages/backlog/backlogFeedback/backlogFeedback.wxml-->
<view class="container">
<view class="bg">
<image src="../../../images/bg_page_blue.png" mode=""/>
</view>
<view class="sign-in-container">
<view class="bg">
<image src="../../../images/bg_record.png" mode=""/>
</view>
<view class="title">
<view class="icon">
<image src="../../../images/icon_success.png" mode=""/>
</view>
<view class="name">已处理</view>
</view>
<view class="inf">
<view class="btn-box">
<view class="btn btn-back" catchtap="comeBack">回待办列表</view>
</view>
</view>
</view>
</view>
@@ -0,0 +1,10 @@
{
"usingComponents": {
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"van-empty": "@vant/weapp/empty/index",
"van-divider": "@vant/weapp/divider/index"
},
"enablePullDownRefresh": true,
"navigationBarTitleText": "待办"
}
@@ -0,0 +1,151 @@
/* pages/backlog/backlogList/backlogList.wxss */
page {
// .container {
width: 100vw;
height: 100vh;
position: relative;
.top {
width: 100%;
background: #ffffff;
position: absolute;
top: 0;
z-index: 10;
.tab-container {
width: 100%;
height: 48px;
display: flex;
overflow: hidden;
.tabs {
width: 100%;
// overflow-x: auto;
}
}
}
>.list {
width: 100%;
height: calc(100vh - 48px);
padding: 8px 0 48px;
box-sizing: border-box;
background: #EFF1F4;
position: absolute;
top: 46px;
// overflow-y: auto;
.scroll-view_H {
height: 100%;
// padding: 0 8px;
box-sizing: border-box;
}
.item {
padding: 12px 10px;
margin: 0 8px 8px;
background: #fff;
border-radius: 8px;
.row:first-child {
margin-bottom: 8px;
}
.row {
color: #2E3A4F;
display: flex;
justify-content: space-between;
align-items: center;
.number-plate {
display: flex;
.status {
padding: 0 4px;
margin: 0 4px;
border-radius: 2px;
color: #FFFFFF;
font-size: 14px;
flex-shrink: 1;
}
.status1 {
background: linear-gradient(90deg, #0D92FF 0%, #38B1FE 100%);
}
.status2 {
background: linear-gradient(270deg, #4CDBAD 0%, #2FCBAB 100%);
}
.status3 {
background: linear-gradient(270deg, #A1A8BB 0%, #838EAA 100%);
}
.val {
font-size: 16px;
font-weight: bold;
flex-shrink: 0;
display: flex;
align-items: center;
}
}
.project-name, .code {
font-size: 14px;
}
.time {
font-size: 14px;
color: #858CA0;
}
.type-list {
display: flex;
.type {
height: 22px;
line-height: 22px;
padding: 0 8px;
margin-left: 5px;
background: #FFF1F0;
border-radius: 4px;
border: 1px solid #FFA39E;
color: #FF4D4F;
font-size: 12px;
}
.color-red {
color: #FF4D4F;
}
}
}
// .item {
// padding: 12px 10px;
// margin-bottom: 8px;
// background: #fff;
// border-radius: 8px;
// .row:first-child {
// margin-bottom: 8px;
// }
// .row {
// color: #2E3A4F;
// display: flex;
// justify-content: space-between;
// align-items: center;
// .project-name {
// font-size: 14px;
// }
// .time {
// font-size: 14px;
// color: #858CA0;
// }
// .type-list {
// display: flex;
// .type {
// height: 22px;
// line-height: 22px;
// padding: 0 8px;
// margin-left: 5px;
// background: #FFF1F0;
// border-radius: 4px;
// border: 1px solid #FFA39E;
// color: #FF4D4F;
// font-size: 12px;
// }
// }
// }
// }
}
.is-last {
padding-bottom: 80px;
}
.no-data {
width: 100%;
height: 100%;
background: #fff;
}
}
// }
}
@@ -0,0 +1,302 @@
// pages/backlog/backlogList/backlogList.ts
import { getAction } from '../../../api/base';
Page({
/**
* 页面的初始数据
*/
data: {
tabList: [] as any,
active: 0,
flowStatus: 2,
current: 1,
recordList: [],
loading: false,
isLast: false
},
getTabList() {
getAction('api/vehicles/backlog/getBacklogCount').then((res: any) => {
if (res.code == 200) {
console.log(res.result);
this.setData({
tabList: res.result
});
console.log(this.data.tabList);
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
});
},
getList() {
let parms = {
type: this.data.flowStatus,
pageNo: this.data.current,
pageSize: 10
};
wx.showLoading({
title: '加载中'
});
if (!this.data.loading) {
this.setData({
loading: true
});
}
getAction('api/vehicles/backlog/getBacklogPage', parms)
.then((res: any) => {
wx.hideLoading();
this.setData({
loading: false
});
if (res.code == 200) {
let tmpArr = this.data.recordList.concat(res.result.records);
this.setData({
listTotal: res.result.total,
recordList: tmpArr
});
if (res.result.total == tmpArr.length) {
// tmpArr 目前只是调试流程用
this.setData({
isLast: true
});
} else {
}
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
})
.catch((err: any) => {
wx.hideLoading();
wx.showToast({
title: err.message,
icon: 'none'
});
});
},
// 变更tab
tabOnChange(e: any) {
console.log(e);
this.setData({
active: e.detail.index,
flowStatus: this.data.tabList[e.detail.index].type,
recordList: [],
current: 1,
isLast: false
});
this.getList();
},
// 跳转到对应的详情页
toDetailPage(e: any) {
let that = this;
console.log('跳转', e.currentTarget.dataset.inf);
wx.setStorageSync('backlogInf', e.currentTarget.dataset.inf);
let url = '';
switch (e.currentTarget.dataset.inf.type) {
case '1': //出险
url = '../insurance/insurance';
break;
case '2': //违章
url = '../violation/violation';
break;
case '3': //事故
url = '../accident/accident';
break;
case '4': //维修
wx.removeStorageSync('backlogInf');
wx.setStorageSync('selectMaintain', e.currentTarget.dataset.inf);
switch (e.currentTarget.dataset.inf.flowStatus) {
case 2:
url = '../../vehicleMaintenance/maintainSend/maintainSend';
break;
case 3:
url = '../../vehicleMaintenance/maintainSend/maintainSend';
break;
case 4:
url = '../../vehicleMaintenance/maintainCheck/maintainCheck';
break;
case 5:
url = '../../vehicleMaintenance/maintainCheck/maintainCheck';
break;
case 10:
url = '../../vehicleMaintenance/maintainCheck/maintainCheck';
break;
case 6:
url =
'../../vehicleMaintenance/maintainProcedure/maintainProcedure';
break;
case 7:
url =
'../../vehicleMaintenance/maintainProcedure/maintainProcedure';
break;
case 8:
url = '../../vehicleMaintenance/maintainResult/maintainResult';
break;
case 9:
url = '../../vehicleMaintenance/maintainResult/maintainResult';
break;
}
// url = '';
break;
case '5': //保养
wx.removeStorageSync('backlogInf');
url = '';
if (e.currentTarget.dataset.inf.planOrBill == 'plan') {
url = '../../UpkeepPlan/UpkeepPlanInfo/UpkeepPlanInfo';
wx.setStorageSync('info', {
info: e.currentTarget.dataset.inf
});
} else {
wx.setStorageSync('selectMaintain', e.currentTarget.dataset.inf);
switch (e.currentTarget.dataset.inf.flowStatus) {
case 2:
url = '../../UpkeepBill/UpkeepBillSend/UpkeepBillSend';
break;
case 3:
url = '../../UpkeepBill/UpkeepBillSend/UpkeepBillSend';
break;
case 4:
url = '../../UpkeepBill/UpkeepBillCheck/UpkeepBillCheck';
break;
case 5:
url = '../../UpkeepBill/UpkeepBillCheck/UpkeepBillCheck';
break;
case 10:
url = '../../UpkeepBill/UpkeepBillCheck/UpkeepBillCheck';
break;
case 6:
url = '../../UpkeepBill/UpkeepBillProcedure/UpkeepBillProcedure';
break;
case 7:
url = '../../UpkeepBill/UpkeepBillProcedure/UpkeepBillProcedure';
break;
case 8:
url = '../../UpkeepBill/UpkeepBillResult/UpkeepBillResult';
break;
case 9:
url = '../../UpkeepBill/UpkeepBillResult/UpkeepBillResult';
break;
}
}
break;
case '6': //年检
url = '../annualInspection/annualInspection';
break;
case '7': //回访
wx.setStorageSync('customerFollowData', e.currentTarget.dataset.inf);
url =
'../../../packageA/pages/customerFollowDetail/customerFollowDetail';
break;
}
if (url == '') {
wx.showToast({
title: '暂无详情',
icon: 'none'
});
return;
}
wx.navigateTo({
url: url,
events: {
// 编辑过后刷新页面
refresh: function () {
that.refresh();
}
},
fail: e => {
console.log(e);
}
});
},
lower(e: any) {
console.log(e.detail.direction == 'bottom');
if (this.data.isLast) {
wx.showToast({
title: '已经是最后一页',
icon: 'none'
});
return;
}
if (e.detail.direction == 'bottom' && !this.data.loading) {
// this.data.current += 1
this.setData({
loading: true,
current: (this.data.current += 1)
});
this.getList();
}
},
refresh() {
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
this.getTabBar().setData({
selected: 1
});
}
this.setData({
recordList: [],
current: 1,
isLast: false
});
this.getTabList();
this.getList();
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
this.refresh();
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
getApp().EventChannel = null;
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
this.setData({
recordList: [],
current: 1,
isLast: false
});
this.getTabList();
this.getList();
//停止下拉刷新
wx.stopPullDownRefresh();
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
});
@@ -0,0 +1,75 @@
<!--pages/backlog/backlogList/backlogList.wxml-->
<!-- <view class="container"> -->
<view class="top">
<view class="tab-container">
<view class="tabs">
<van-tabs color="#4381FC" title-active-color="#4381FC" ellipsis="{{false}}" active="{{ active }}" bind:change="tabOnChange">
<van-tab title-style="font-size:16px" wx:for="{{tabList}}" wx:key="index" title="{{item.name + '(' + item.count + ')' }}"></van-tab>
</van-tabs>
</view>
</view>
</view>
<view class="list">
<scroll-view class="scroll-view_H" scroll-y="true" bindscrolltolower="lower" style="width: 100%">
<view class="item" wx:if="{{flowStatus == 4 || flowStatus == 5}}" wx:for="{{recordList}}" wx:key="index" data-inf="{{item}}" catchtap="toDetailPage">
<view class="row">
<view class="code">{{item.orderNo ? item.orderNo : '-'}}</view>
<view class="number-plate">
<view class="status status1" wx:if="{{item.flowStatus == 2 || item.flowStatus == 3 || item.flowStatus == 6}}">{{item.flowStatusName}}</view>
<view class="status status2" wx:if="{{item.flowStatus == 4 || item.flowStatus == 5 || item.flowStatus == 7 || item.flowStatus == 10}}">{{item.flowStatusName}}</view>
<view class="status status3" wx:if="{{item.flowStatus == 8 || item.flowStatus == 9}}">{{item.flowStatusName}}</view>
<view class="val">{{item.plateNumber}}</view>
</view>
</view>
<view class="row">
<view class="project-name">{{item.projectId_dictText}}</view>
<view class="time">{{item.time}}</view>
</view>
</view>
<view class="item" wx:if="{{flowStatus != 4 && flowStatus != 5 && flowStatus != 7}}" wx:for="{{recordList}}" wx:key="index" data-inf="{{item}}" catchtap="toDetailPage">
<view class="row">
<view class="number-plate">
<view class="val">{{item.plateNumber}}</view>
</view>
<view class="project-name">{{item.projectId_dictText}}</view>
</view>
<view class="row">
<view class="time" wx:if="{{item.type == 1}}">出险时间: {{item.time}}</view>
<view class="time" wx:elif="{{item.type == 2}}">违章时间: {{item.time}}</view>
<view class="time" wx:elif="{{item.type == 4}}">事故时间: {{item.time}}</view>
<view class="time" wx:elif="{{item.type == 6}}">年检有效期: {{item.time}}</view>
<view class="time" wx:else>{{item.time ? item.time : '-'}}</view>
<view class="type-list">
<view wx:if="{{item.type == 1}}"></view>
<view class="type" wx:elif="{{item.type == 2}}">{{item.violationAct_dictText}}</view>
<view class="type" wx:elif="{{item.type == 3}}">{{item.natureEstimate_dictText}}</view>
<view class="color-red" wx:elif="{{item.type == 6}}">
{{item.overdueType ? item.overdueType : '已逾期'}}{{(item.overdueDays ? item.overdueDays : item.daysToOverdue)}}天
</view>
<view wx:else>-</view>
</view>
</view>
</view>
<view class="item" wx:if="{{flowStatus == 7}}" wx:for="{{recordList}}" wx:key="index" data-inf="{{item}}" catchtap="toDetailPage">
<view class="row">
<view class="number-plate">
<view class="val">{{item.projectId_dictText}}</view>
</view>
<view class="project-name">{{item.followType}}</view>
</view>
<view class="row">
<view class="time">计划回访时间:{{item.time ? item.time : '-'}}</view>
<view class="type-list">
<view class="type">{{item.followStatus}}</view>
</view>
</view>
</view>
<view class="is-last" wx:if="{{isLast && recordList.length > 0}}">
<van-divider contentPosition="center">已加载完全部数据</van-divider>
</view>
<view class="no-data" wx:if="{{recordList.length == 0}}">
<van-empty description="无数据" />
</view>
</scroll-view>
</view>
<!-- </view> -->
@@ -0,0 +1,7 @@
{
"usingComponents": {
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index"
},
"navigationBarTitleText": "出险详情"
}
@@ -0,0 +1,184 @@
/* pages/backlog/insurance/insurance.wxss */
.container {
height: 100vh;
padding-top: 2px;
box-sizing: border-box;
background: #EFF1F4;
overflow: hidden;
position: relative;
.bg {
width: 100%;
height: 250px;
position: absolute;
top: 0;
image {
width: 100%;
height: 100%;
display: block;
}
}
.top {
margin: 8px 8px 10px;
padding: 12px 10px;
margin-bottom: 8px;
background: #fff;
border-radius: 8px;
position: relative;
.row:first-child {
margin-bottom: 8px;
}
.row {
color: #2E3A4F;
display: flex;
justify-content: space-between;
align-items: center;
.number-plate {
display: flex;
.status {
padding: 0 6px;
margin-right: 4px;
border-radius: 2px;
color: #FFFFFF;
font-size: 14px;
}
.status1 {
background: linear-gradient(90deg, #0D92FF 0%, #38B1FE 100%);
}
.status2 {
background: linear-gradient(270deg, #4CDBAD 0%, #2FCBAB 100%);
}
.status3 {
background: linear-gradient(270deg, #A1A8BB 0%, #838EAA 100%);
}
.val {
font-size: 16px;
font-weight: bold;
}
}
.project-name, .code {
font-size: 14px;
}
.time {
font-size: 14px;
color: #858CA0;
}
}
}
.detail-container {
max-height: calc(100vh - 72px - 80px);
box-sizing: border-box;
padding: 0px 8px 0px;
overflow: hidden;
position: relative;
.tabs {
display: flex;
.tab {
width: 50%;
height: 40px;
line-height: 40px;
// background: #fff;
border-radius: 8px 8px 0 0;
color: #4381FC;
font-size: 16px;
font-weight: 500;
text-align: center;
position: relative;
.bg {
width: 100%;
height: 100%;
position: absolute;
image {
width: 100%;
height: 100%;
display: block;
}
}
.value {
position: relative;
}
}
.active::after {
content: '';
width: 26px;
height: 4px;
background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%);
border-radius: 2px;
position: absolute;
bottom: 2px;
left: 50%;
transform: translateX(-50%);
}
}
.content-borderall {
border-radius: 8px;
}
.content {
max-height: calc(100vh - 72px - 80px - 80px);
padding: 12px 8px;
// box-sizing: border-box;
border-radius: 0px 8px 8px 8px;
background: #fff;
overflow-y: auto;
.row {
margin-bottom: 8px;
display: flex;
justify-content: space-between;
// align-items: center;
.label {
margin-right: 4px;
color: #858CA0;
font-size: 14px;
white-space: nowrap;
}
.val {
color: #2E3A4F;
font-size: 14px;
}
.pic-box {
max-width: 70%;
display: flex;
justify-content: flex-end;
flex-wrap: wrap;
.item {
width: 84px;
height: 84px;
padding-left: 8px;
display: flex;
align-items: center;
image {
width: 100%;
height: 100%;
display: block;
}
}
}
}
}
}
.bottom {
width: 100%;
padding: 10px 8px 30px;
background: #fff;
box-sizing: border-box;
border-radius: 8px 8px 0 0;
box-shadow: 0px -2px 12px 0px rgba(0,0,0,0.2);
position: absolute;
bottom: 0;
left: 0;
.btn-box {
width: 100%;
display: flex;
justify-content: space-between;
.btn {
width: 100%;
height: 40px;
line-height: 40px;
border-radius: 8px;
background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%);
color: #fff;
font-weight: bold;
text-align: center;
}
}
}
}
@@ -0,0 +1,124 @@
// pages/backlog/insurance/insurance.ts
import { getAction } from '../../../api/base';
Page({
/**
* 页面的初始数据
*/
data: {
tabActive: 0,
id: '',
item: {} as any
},
getDetailInf() {
let parms = {
id: this.data.id
};
getAction('api/vehicles/backlog/getInsuranceRecordById', parms).then(
(res: any) => {
if (res.code == 200) {
console.log(res.result);
// res.result.forEach((item: any) => {
res.result.accidentUrlList = res.result.accidentUrl
? res.result.accidentUrl.split(',')
: [];
res.result.compensateAgreementUrlList = res.result
.compensateAgreementUrl
? res.result.compensateAgreementUrl.split(',')
: [];
res.result.lossAssessmentUrlList = res.result.lossAssessmentUrl
? res.result.lossAssessmentUrl.split(',')
: [];
res.result.compensateUrlList = res.result.compensateUrl
? res.result.compensateUrl.split(',')
: [];
res.result.otherUrlList = res.result.otherUrl
? res.result.otherUrl.split(',')
: [];
// });
this.setData({
item: res.result
});
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
}
);
},
previewImg(e: any) {
let that = this;
let { index, key } = e.currentTarget.dataset;
wx.previewImage({
current: that.data.item[key][index | 0], // 当前显示图片的http链接 默认urls[0]
urls: that.data.item[key] // 需要预览的图片http链接列表
});
},
toFeedback() {
let that = this;
// 违章信息
wx.setStorageSync('violation', '');
// 跳转到违章处理反馈
wx.navigateTo({
url: '../insuranceFeedback/insuranceFeedback',
success: function (res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('eventName', { ...that.data.item });
},
fail: e => {
console.log(e);
}
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
const eventChannel = this.getOpenerEventChannel();
getApp().EventChannel = eventChannel;
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
let id = wx.getStorageSync('backlogInf').id;
this.setData({
id: id
});
this.getDetailInf();
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
});
@@ -0,0 +1,137 @@
<!--pages/backlog/insurance/insurance.wxml-->
<view class="container">
<view class="bg">
<image src="../../../images/bg_page_blue.png" mode=""/>
</view>
<view class="top">
<view class="row">
<view class="code">{{item.id}}</view>
<view class="number-plate">
<view class="val">{{item.vehicleId_dictText}}</view>
</view>
</view>
<view class="row">
<view class="project-name">{{item.projectId_dictText}}</view>
<view class="time">{{item.insuranceDate}}</view>
</view>
</view>
<view class="detail-container">
<view class="tabs">
<view class="tab {{tabActive == 0 ? 'active' : ''}}" data-tab="0" catch:tap="changeTab">
<view class="bg"><image src="../../../images/btn_l.png" mode=""/></view>
<view class="value">出险信息</view>
</view>
<!-- <view class="tab {{tabActive == 1 ? 'active' : ''}}" data-tab="1" catch:tap="changeTab">报价信息</view> -->
</view>
<view class="content">
<view class="row">
<view class="label">保险公司</view>
<view class="val">{{item.companyId_dictText ? item.companyId_dictText : '/'}}</view>
</view>
<view class="row">
<view class="label">理赔案号</view>
<view class="val">{{item.insuranceNo ? item.insuranceNo : '/'}}</view>
</view>
<view class="row">
<view class="label">理赔金额</view>
<view class="val">{{item.insurancePrice ? item.insurancePrice : '0'}}元</view>
</view>
<view class="row">
<view class="label">处理人</view>
<view class="val"> {{item.handleUser ? item.handleUser : '/'}}</view>
</view>
<view class="row">
<view class="label">备注</view>
<view class="val">{{item.remark ? item.remark : '/'}}</view>
</view>
<view class="row">
<view class="label">事故认定书</view>
<view class="pic-box">
<view class="item"
wx:for="{{item.accidentUrlList}}"
wx:key="index"
wx:for-item="pic"
wx:if="{{item.accidentUrlList.length > 0}}"
data-index="{{index}}"
data-key="accidentUrlList"
bindtap="previewImg">
<image src="{{pic}}" mode=""/>
</view>
<view class="val" wx:if="{{item.accidentUrlList.length == 0}}">无</view>
</view>
</view>
<view class="row">
<view class="label">赔偿协议书</view>
<view class="pic-box">
<view
class="item"
wx:for="{{item.compensateAgreementUrlList}}"
wx:key="index"
wx:for-item="pic"
wx:if="{{item.compensateAgreementUrlList.length > 0}}"
data-index="{{index}}"
data-key="compensateAgreementUrlList"
bindtap="previewImg">
<image src="{{pic}}" mode=""/>
</view>
<view class="val" wx:if="{{item.compensateAgreementUrlList.length == 0}}">无</view>
</view>
</view>
<view class="row">
<view class="label">定损单</view>
<view class="pic-box">
<view
class="item"
wx:for="{{item.lossAssessmentUrlList}}"
wx:key="index"
wx:for-item="pic"
wx:if="{{lossAssessmentUrlList.length > 0}}"
data-index="{{index}}"
data-key="lossAssessmentUrlList"
bindtap="previewImg">
<image src="{{pic}}" mode=""/>
</view>
<view class="val" wx:if="{{item.lossAssessmentUrlList.length == 0}}">无</view>
</view>
</view>
<view class="row">
<view class="label">理赔单据</view>
<view class="pic-box">
<view class="item"
wx:for="{{item.compensateUrlList}}"
wx:key="index"
wx:for-item="pic"
wx:if="{{item.compensateUrlList.length > 0}}"
data-index="{{index}}"
data-key="compensateUrlList"
bindtap="previewImg">
<image src="{{pic}}" mode=""/>
</view>
<view class="val" wx:if="{{item.compensateUrlList.length == 0}}">无</view>
</view>
</view>
<view class="row">
<view class="label">其他</view>
<view class="pic-box">
<view
class="item"
wx:for="{{item.otherUrlList}}"
wx:key="index"
wx:for-item="pic"
wx:if="{{item.otherUrlList.length > 0}}"
data-index="{{index}}"
data-key="otherUrlList"
bindtap="previewImg">
<image src="{{pic}}" mode=""/>
</view>
<view class="val" wx:if="{{item.otherUrlList.length == 0}}">无</view>
</view>
</view>
</view>
</view>
<view class="bottom">
<view class="btn-box">
<view class="btn" catch:tap="toFeedback">处理反馈</view>
</view>
</view>
</view>
@@ -0,0 +1,7 @@
{
"usingComponents": {
"g-upload": "/components/uploadPic/uploadPic",
"van-uploader": "@vant/weapp/uploader/index"
},
"navigationBarTitleText": "出险处理反馈"
}
@@ -0,0 +1,150 @@
/* pages/backlog/insuranceFeedback/insuranceFeedback.wxss */
.container {
height: 100vh;
padding-top: 2px;
box-sizing: border-box;
background: #EFF1F4;
overflow: hidden;
position: relative;
.content {
max-height: calc(100vh - 110px);
padding: 12px 8px 4px;
background: #fff;
border-radius: 0 0 8px 8px;
overflow-y: auto;
.row {
width: 100%;
min-height: 36px;
padding: 8px 10px;
margin-bottom: 8px;
box-sizing: border-box;
box-shadow: 0px 1px 0px 0px #E6EAF2;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
position: relative;
.label {
color: #2F3B50;
font-size: 14px;
}
.select {
width: 70%;
position: absolute;
right: 10px;
picker {
width: 100%;
text-align: right;
position: relative;
.picker {
width: 100%;
height: 38px;
padding-right: 20px;
box-sizing: border-box;
// border: 1px solid #E6EAF2;
border-radius: 4px;
font-size: 14px;
display: flex;
justify-content: flex-end;
align-items: center;
}
.picker::after {
content: '';
width: 0;
height: 0;
border-top: 6px solid #636B83;
border-right: 6px solid transparent;
border-bottom: 6px solid transparent;
border-left: 6px solid transparent;
position: absolute;
top: 50%;
right: 4px;
transform: translateY(-2px);
}
}
}
.val {
display: flex;
align-items: center;
input {
text-align: right;
}
.unit {
width: 24rpx;
margin-left: 6px;
color: #636B83;
font-size: 28rpx;
white-space: nowrap;
}
}
.marker {
width: 100%;
margin-top: 8px;
color: #949CB5;
font-size: 14px;
}
.upload {
width: 100%;
margin-top: 8px;
.upload-box {
width: 80px;
height: 80px;
background: #ECF1FF;
border-radius: 4px;
border: 1px dashed #4381FC;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
image {
width: 20px;
height: 20px;
margin: 16rpx 0 8rpx;
}
.val {
color: #4381FC;
font-size: 14px;
}
}
}
}
}
.bottom {
width: 100%;
padding: 22px 10px;
background: #fff;
box-sizing: border-box;
border-radius: 8px 8px 0 0;
box-shadow: 0px -2px 12px 0px rgba(0,0,0,0.2);
position: absolute;
bottom: 0;
left: 0;
.btn-box {
width: 100%;
display: flex;
justify-content: space-between;
.btn {
width: 100%;
height: 40px;
line-height: 40px;
border-radius: 8px;
background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%);
color: #fff;
font-weight: bold;
text-align: center;
}
}
}
}
.van-uploader__preview-delete {
.van-uploader__preview-delete-icon {
transform: scale(.7) translate(0,0);
}
}
.van-uploader__preview-delete:after {
background-color: #F56B6B !important;
border-top-left-radius: 12px !important;
border-top-right-radius: 12px !important;
border-bottom-right-radius: 12px !important;
border-bottom-left-radius: 12px !important;
}
@@ -0,0 +1,386 @@
// pages/backlog/insuranceFeedback/insuranceFeedback.ts
import { putAction, upload, getAction } from '../../../api/base';
Page({
/**
* 页面的初始数据
*/
data: {
detailInf: {} as any,
options: [],
selectIndex: 0,
selectOption: {} as any,
marker: '',
photoList: {
accidentUrl: [],
compensateAgreementUrl: [],
lossAssessmentUrl: [],
compensateUrl: [],
otherUrl: [],
accidentUrlStr: '',
compensateAgreementUrlStr: '',
lossAssessmentUrlStr: '',
compensateUrlStr: '',
otherUrlStr: ''
} as any,
uploadUrl: 'api/vehicles/accidentInfo/upload'
},
initPhotoList() {
let tmp = this.data.photoList;
// 回显用
let tmp2: any = Object.assign({}, this.data.photoList);
for (let key in tmp) {
if (this.data.detailInf[key]) {
tmp[key] = this.data.detailInf[key].split(',');
// 回显用
tmp[key].forEach((item: any) => {
tmp2[key].push({
fileUrl: item
});
});
}
}
this.setData({
photoList: tmp
});
// this.selectComponent('#accidentUrl').initPhotoList(tmp2.accidentUrl);
console.log(this.data.photoList);
},
getInsuranceCompanyList() {
getAction('api/base/insuranceCompany/insuranceCompanyList')
.then((res: any) => {
if (res.code == 200) {
console.log(res);
let selectIndex = res.result.findIndex(
(x: any) => x.id == this.data.detailInf.companyId
);
this.setData({
options: res.result,
selectIndex: selectIndex,
selectOption: res.result[selectIndex]
});
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
})
.catch((err: any) => {
this.setData({
loading: false
});
wx.showToast({
title: err.message,
icon: 'none'
});
});
},
bindPicker(e: any) {
console.log(e.detail.value);
let index = Number(e.detail.value);
this.setData({
selectIndex: index,
selectOption: this.data.options[index]
});
},
getVal(e: any) {
console.log(e);
let tmp = this.data.detailInf;
let key = e.currentTarget.dataset.key;
if (key == 'insurancePrice') {
let detail = e.detail;
tmp[key] = Number(detail.value) > 99999999 ? 99999999 : detail.value;
} else {
tmp[key] = e.detail.value;
}
this.setData({
detailInf: tmp
});
},
onClose() {
this.setData({
show: false
});
},
returnPic(e: any) {
console.log(e.detail.photoList);
let urlList = [] as any;
e.detail.photoList.forEach((item: any) => {
urlList.push(item.fileUrl);
});
let tmp = this.data.photoList;
tmp[e.currentTarget.dataset.key] = urlList;
this.setData({
photoList: tmp
});
},
// 上传
afterRead(e: any) {
console.log(e);
let { fieldname } = e.currentTarget.dataset;
const file = e.detail;
let option = {
name: 'file',
filePath: e.detail.file.url
};
this.setData({
uploading: true
});
upload('api/vehicleCheck/upload', option).then((res: any) => {
this.setData({
uploading: false
});
let tempData = JSON.parse(res.data);
if (tempData.code == 200) {
let otherPhotoFile: any = this.data.photoList[fieldname];
otherPhotoFile.push({ ...file, url: tempData.result.fileUrl });
let data: any = this.data;
let urls = '' as any;
otherPhotoFile.forEach((p: any) => {
urls += p.url + ',';
});
urls = urls.slice(0, -1);
data.photoList[fieldname + 'Str'] = urls;
data.photoList[fieldname] = otherPhotoFile;
console.log(data.photoList);
this.setData(data);
} else {
wx.showToast({
title: '上传失败,请重试',
icon: 'none'
});
}
});
},
deletePhoto(e: any) {
let { fieldname } = e.currentTarget.dataset;
let otherPhotoFile = this.data.photoList[fieldname + 'List'];
let index = e.detail.index;
otherPhotoFile.splice(index, 1);
let data: any = this.data;
let urls = '' as any;
otherPhotoFile.forEach((p: any) => {
urls += p.url + ',';
});
urls = urls.slice(0, -1);
data.photoList[fieldname + 'Str'] = urls;
data.photoList[fieldname] = otherPhotoFile;
this.setData(data);
},
checkStr(str: string) {
let returnStr = '';
let spaceRegex = /^\S*$/;
let regex = /[!@#$%^&*?><|\\\\]/;
let tooLong = str.length > 32;
if (!spaceRegex.test(str)) {
returnStr = '不支持含有空格';
} else if (regex.test(str)) {
returnStr = '不支持特殊字符';
} else if (tooLong) {
returnStr = '输入长度不得超过32个字符';
} else {
returnStr = '';
}
return returnStr;
},
bindSend() {
let parms = this.data.detailInf;
parms = Object.assign(parms, {
accidentUrl: this.data.photoList.accidentUrlStr,
compensateAgreementUrl: this.data.photoList.compensateAgreementUrlStr,
lossAssessmentUrl: this.data.photoList.lossAssessmentUrlStr,
compensateUrl: this.data.photoList.compensateUrlStr,
otherUrl: this.data.photoList.otherUrlStr
});
// 验证非必填
if (parms.insuranceNo) {
let msg = this.checkStr(parms.insuranceNo);
if (msg) {
wx.showToast({
title: '理赔案号:' + msg,
icon: 'none'
});
return;
}
}
if (parms.insurancePrice) {
let regPos = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/;
let msg = !regPos.test(parms.insurancePrice);
if (parms.insurancePrice > 99999999) {
wx.showToast({
title: '赔偿金额上限为99999999',
icon: 'none'
});
return;
}
if (msg) {
wx.showToast({
title: '赔偿金额为正数且最多保留两位小数',
icon: 'none'
});
return;
}
}
if (parms.handleUser) {
let msg = this.checkStr(parms.insuranceNo);
if (msg) {
wx.showToast({
title: '处理人:' + msg,
icon: 'none'
});
return;
}
}
if (parms.remark) {
let msg = this.checkStr(parms.remark);
if (msg) {
wx.showToast({
title: '备注:' + msg,
icon: 'none'
});
return;
}
}
wx.showLoading({
title: '提交中',
icon: 'none'
});
putAction('api/insuranceRecord/edit', parms).then((res: any) => {
wx.hideLoading();
if (res.code == 200) {
console.log(res.result);
// setTimeout(() => {
// wx.navigateBack({ delta: 2 });
// }, 1500);
wx.navigateTo({
url: '../backlogFeedback/backlogFeedback',
fail: e => {
console.log(e);
}
});
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
console.log('onLoad');
// 接收传参
const eventChannel = this.getOpenerEventChannel();
eventChannel &&
eventChannel.on &&
eventChannel.on('eventName', data => {
console.log('接收参数', data);
let picList = this.data.photoList;
if (data.accidentUrl) {
for (let i = 0; i < data.accidentUrl.split(',').length; i++) {
let pic = data.accidentUrl.split(',')[i];
picList.accidentUrlStr = data.accidentUrl;
picList.accidentUrl.push({
url: pic,
name: ''
});
}
}
if (data.compensateAgreementUrl) {
for (
let i = 0;
i < data.compensateAgreementUrl.split(',').length;
i++
) {
let pic = data.compensateAgreementUrl.split(',')[i];
picList.compensateAgreementUrlStr = data.compensateAgreementUrl;
picList.compensateAgreementUrl.push({
url: pic,
name: ''
});
}
}
if (data.compensateUrl) {
for (let i = 0; i < data.compensateUrl.split(',').length; i++) {
let pic = data.compensateUrl.split(',')[i];
picList.compensateUrlStr = data.compensateUrl;
picList.compensateUrl.push({
url: pic,
name: ''
});
}
}
if (data.lossAssessmentUrl) {
for (let i = 0; i < data.lossAssessmentUrl.split(',').length; i++) {
let pic = data.lossAssessmentUrl.split(',')[i];
picList.lossAssessmentUrlStr = data.lossAssessmentUrl;
picList.lossAssessmentUrl.push({
url: pic,
name: ''
});
}
}
if (data.otherUrl) {
for (let i = 0; i < data.otherUrl.split(',').length; i++) {
let pic = data.otherUrl.split(',')[i];
picList.otherUrlStr = data.otherUrl;
picList.otherUrl.push({
url: pic,
name: ''
});
}
}
console.log(picList);
this.setData({
detailInf: data,
photoList: picList
});
// this.initPhotoList();
this.getInsuranceCompanyList();
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
console.log('onReady');
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
});
@@ -0,0 +1,197 @@
<!--pages/backlog/insuranceFeedback/insuranceFeedback.wxml-->
<view class="container">
<view class="content">
<view class="row">
<view class="label">保险公司</view>
<view class="select">
<picker bindchange="bindPicker" value="{{selectIndex}}" range-key="name" range="{{options}}">
<view class="picker project-select">
{{options[selectIndex].name}}
</view>
</picker>
</view>
</view>
<view class="row">
<view class="label">理赔案号</view>
<view class="val">
<input
type="text"
placeholder="请输入"
placeholder-style="color: #949CB5; font-size: 28rpx;"
value="{{detailInf.insuranceNo}}"
data-key="insuranceNo"
bindinput="getVal"/>
</view>
</view>
<view class="row">
<view class="label">赔偿金额</view>
<view class="val">
<input
type="digit"
placeholder="请输入"
placeholder-style="color: #949CB5; font-size: 28rpx;"
value="{{detailInf.insurancePrice}}"
data-key="insurancePrice"
bindinput="getVal"/>
<view class="unit">元</view>
</view>
</view>
<view class="row">
<view class="label">处理人</view>
<view class="val">
<input
type="text"
placeholder="请输入"
placeholder-style="color: #949CB5; font-size: 28rpx;"
value="{{detailInf.handleUser}}"
data-key="handleUser"
bindinput="getVal"/>
</view>
</view>
<view class="row">
<view class="label">备注</view>
<view class="marker">
<textarea
type="text"
placeholder="请输入备注"
style="height: 96rpx;"
placeholder-style="color: #949CB5; font-size: 28rpx; font-weight: 400;"
value="{{detailInf.marker}}"
data-key="marker"
bindinput="getVal"/>
</view>
</view>
<view class="row">
<view class="label">事故认定书</view>
<view class="upload">
<!-- <g-upload
id="accidentUrl"
maxLength="{{10}}"
picList="{{photoList.accidentUrllist}}"
uploadUrl="{{uploadUrl}}"
data-key="accidentUrl"
bind:returnPic="returnPic"></g-upload> -->
<van-uploader
file-list="{{ photoList.accidentUrl }}"
deletable="{{ true }}"
max-count="10"
data-fieldName="accidentUrl"
bind:after-read="afterRead"
bind:delete="deletePhoto" >
<view class="upload-box">
<image src="../../../images/icon_upload.png" mode=""/>
<view class="val">上传图片</view>
</view>
</van-uploader>
</view>
</view>
<view class="row">
<view class="label">赔偿协议书</view>
<view class="upload">
<!-- <g-upload
maxLength="{{10}}"
picList="{{photoList.compensateAgreementUrllist}}"
uploadUrl="{{uploadUrl}}"
data-key="compensateAgreementUrl"
bind:returnPic="returnPic"></g-upload>
-->
<van-uploader
file-list="{{ photoList.compensateAgreementUrl }}"
deletable="{{ true }}"
max-count="10"
data-fieldName="compensateAgreementUrl"
bind:after-read="afterRead"
bind:delete="deletePhoto" >
<view class="upload-box">
<image src="../../../images/icon_upload.png" mode=""/>
<view class="val">上传图片</view>
</view>
</van-uploader>
</view>
</view>
<view class="row">
<view class="label">定损单</view>
<view class="upload">
<!-- <g-upload
maxLength="{{10}}"
picList="{{photoList.lossAssessmentUrllist}}"
uploadUrl="{{uploadUrl}}"
data-key="lossAssessmentUrl"
bind:returnPic="returnPic"></g-upload> -->
<van-uploader
file-list="{{ photoList.lossAssessmentUrl }}"
deletable="{{ true }}"
max-count="10"
data-fieldName="lossAssessmentUrl"
bind:after-read="afterRead"
bind:delete="deletePhoto" >
<view class="upload-box">
<image src="../../../images/icon_upload.png" mode=""/>
<view class="val">上传图片</view>
</view>
</van-uploader>
</view>
</view>
<view class="row">
<view class="label">理赔单据</view>
<view class="upload">
<!-- <g-upload
maxLength="{{10}}"
picList="{{photoList.compensateUrllist}}"
uploadUrl="{{uploadUrl}}"
data-key="compensateUrl"
bind:returnPic="returnPic"></g-upload> -->
<van-uploader
file-list="{{ photoList.compensateUrl }}"
deletable="{{ true }}"
max-count="10"
data-fieldName="compensateUrl"
bind:after-read="afterRead"
bind:delete="deletePhoto" >
<view class="upload-box">
<image src="../../../images/icon_upload.png" mode=""/>
<view class="val">上传图片</view>
</view>
</van-uploader>
</view>
</view>
<view class="row">
<view class="label">其他</view>
<view class="upload">
<!-- <g-upload
maxLength="{{10}}"
picList="{{photoList.otherUrllist}}"
uploadUrl="{{uploadUrl}}"
data-key="otherUrl"
bind:returnPic="returnPic"></g-upload> -->
<van-uploader
file-list="{{ photoList.otherUrl }}"
deletable="{{ true }}"
max-count="10"
data-fieldName="otherUrl"
bind:after-read="afterRead"
bind:delete="deletePhoto" >
<view class="upload-box">
<image src="../../../images/icon_upload.png" mode=""/>
<view class="val">上传图片</view>
</view>
</van-uploader>
</view>
</view>
</view>
<view class="bottom">
<view class="btn-box">
<view class="btn" catch:tap="bindSend">提交</view>
</view>
</view>
<van-popup show="{{ show }}" position="bottom" bind:close="onClose">
<van-datetime-picker
type="datetime"
value="{{ currentDate }}"
bind:confirm="dateOnInput"
bind:cancel="onClose"
/>
</van-popup>
</view>
@@ -0,0 +1,7 @@
{
"usingComponents": {
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index"
},
"navigationBarTitleText": "违章详情"
}
@@ -0,0 +1,198 @@
/* pages/backlog/violation/violation.wxss */
.container {
height: 100vh;
padding-top: 2px;
box-sizing: border-box;
background: #EFF1F4;
overflow: hidden;
position: relative;
.bg {
width: 100%;
height: 250px;
position: absolute;
top: 0;
image {
width: 100%;
height: 100%;
display: block;
}
}
.top {
margin: 8px 8px 10px;
padding: 12px 10px;
margin-bottom: 8px;
background: #fff;
border-radius: 8px;
position: relative;
.row:first-child {
margin-bottom: 8px;
}
.row {
color: #2E3A4F;
display: flex;
justify-content: space-between;
align-items: center;
.number-plate {
display: flex;
.status {
padding: 0 6px;
margin-right: 4px;
border-radius: 2px;
color: #FFFFFF;
font-size: 14px;
}
.status1 {
background: linear-gradient(90deg, #0D92FF 0%, #38B1FE 100%);
}
.status2 {
background: linear-gradient(270deg, #4CDBAD 0%, #2FCBAB 100%);
}
.status3 {
background: linear-gradient(270deg, #A1A8BB 0%, #838EAA 100%);
}
.val {
font-size: 16px;
font-weight: bold;
}
}
.project-name, .code {
font-size: 14px;
}
.time {
font-size: 14px;
color: #858CA0;
}
.type-list {
display: flex;
.type {
height: 22px;
line-height: 22px;
padding: 0 8px;
margin-left: 5px;
background: #FFF1F0;
border-radius: 4px;
border: 1px solid #FFA39E;
color: #FF4D4F;
font-size: 12px;
}
}
}
}
.detail-container {
max-height: calc(100vh - 72px - 80px - 20px);
box-sizing: border-box;
padding: 0px 8px 0px;
overflow: hidden;
position: relative;
.tabs {
display: flex;
.tab {
width: 50%;
height: 40px;
line-height: 40px;
// background: #fff;
border-radius: 8px 8px 0 0;
color: #4381FC;
font-size: 16px;
font-weight: 500;
text-align: center;
position: relative;
.bg {
width: 100%;
height: 100%;
position: absolute;
image {
width: 100%;
height: 100%;
display: block;
}
}
.value {
position: relative;
}
}
.active::after {
content: '';
width: 26px;
height: 4px;
background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%);
border-radius: 2px;
position: absolute;
bottom: 2px;
left: 50%;
transform: translateX(-50%);
}
}
.content-borderall {
border-radius: 8px;
}
.content {
max-height: calc(100vh - 72px - 80px - 100px);
padding: 12px 10px;
// box-sizing: border-box;
border-radius: 0px 8px 8px 8px;
background: #fff;
overflow-y: auto;
.row {
margin-bottom: 8px;
display: flex;
justify-content: space-between;
// align-items: center;
.label {
margin-right: 4px;
color: #858CA0;
font-size: 14px;
white-space: nowrap;
}
.val {
color: #2E3A4F;
font-size: 14px;
}
.pic-box {
max-width: 70%;
display: flex;
justify-content: flex-end;
flex-wrap: wrap;
.item {
width: 84px;
height: 84px;
padding-left: 8px;
display: flex;
align-items: center;
image {
width: 100%;
height: 100%;
display: block;
}
}
}
}
}
}
.bottom {
width: 100%;
padding: 10px 8px 30px;
background: #fff;
box-sizing: border-box;
border-radius: 8px 8px 0 0;
box-shadow: 0px -2px 12px 0px rgba(0,0,0,0.2);
position: absolute;
bottom: 0;
left: 0;
.btn-box {
width: 100%;
display: flex;
justify-content: space-between;
.btn {
width: 100%;
height: 40px;
line-height: 40px;
border-radius: 8px;
background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%);
color: #fff;
font-weight: bold;
text-align: center;
}
}
}
}
@@ -0,0 +1,105 @@
// pages/backlog/violation/violation.ts
import { getAction } from '../../../api/base';
Page({
/**
* 页面的初始数据
*/
data: {
tabActive: 0,
id: '',
item: {}
},
// 变更tab
changeTab(e: any) {
console.log(e.currentTarget.dataset.tab);
this.setData({
tabActive: e.currentTarget.dataset.tab
});
},
getDetailInf() {
let parms = {
id: this.data.id
};
getAction('api/vehicles/backlog/getViolationRecorddById', parms).then(
(res: any) => {
if (res.code == 200) {
console.log(res.result);
this.setData({
item: res.result
});
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
}
);
},
toFeedback() {
let that = this;
// 违章信息
wx.setStorageSync('violation', '');
// 跳转到违章处理反馈
wx.navigateTo({
url: '../violationFeedback/violationFeedback',
success: function (res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('eventName', { ...that.data.item });
},
fail: e => {
console.log(e);
}
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
const eventChannel = this.getOpenerEventChannel();
getApp().EventChannel = eventChannel;
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
let id = wx.getStorageSync('backlogInf').id;
this.setData({
id: id
});
this.getDetailInf();
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
});
@@ -0,0 +1,65 @@
<!--pages/backlog/violation/violation.wxml-->
<view class="container">
<view class="bg">
<image src="../../../images/bg_page_blue.png" mode=""/>
</view>
<view class="top">
<view class="row">
<view class="number-plate">
<view class="val">{{item.plateNumber}}</view>
</view>
<view class="project-name">{{item.projectId_dictText}}</view>
</view>
<view class="row">
<view class="time">违章时间: {{item.violationTime}}</view>
<view class="time" wx:if="{{!item.status}}">{{item.time}}</view>
<view class="type-list">
<view class="type">{{item.violationAct_dictText}}</view>
</view>
</view>
</view>
<view class="detail-container">
<view class="tabs">
<view class="tab {{tabActive == 0 ? 'active' : ''}}" data-tab="0" catch:tap="changeTab">
<view class="bg"><image src="../../../images/btn_l.png" mode=""/></view>
<view class="value">违章信息</view>
</view>
<!-- <view class="tab {{tabActive == 1 ? 'active' : ''}}" data-tab="1" catch:tap="changeTab">报价信息</view> -->
</view>
<view class="content">
<view class="row">
<view class="label">负责人</view>
<view class="val">{{ item.director ? item.director : '/'}}</view>
</view>
<view class="row">
<view class="label">违章地点</view>
<view class="val">{{ item.violationAddress ? item.violationAddress : '/'}}</view>
</view>
<view class="row">
<view class="label">违章司机</view>
<view class="val">{{ item.violationDriver ? item.violationDriver : '/'}}</view>
</view>
<view class="row">
<view class="label">违章记分</view>
<view class="val"> {{ item.violationScore ? item.violationScore : '/'}}</view>
</view>
<view class="row">
<view class="label">违章费用</view>
<view class="val">{{ item.violationCost ? item.violationCost : '0'}}元</view>
</view>
<view class="row">
<view class="label">处理限期</view>
<view class="val">{{ item.violationAct ? item.violationAct : '/'}}天</view>
</view>
<view class="row">
<view class="label">违章行为描述</view>
<view class="val">{{ item.violationActDes ? item.violationActDes : '/'}}</view>
</view>
</view>
</view>
<view class="bottom">
<view class="btn-box">
<view class="btn" catch:tap="toFeedback">处理反馈</view>
</view>
</view>
</view>
@@ -0,0 +1,9 @@
{
"usingComponents": {
"g-upload": "/components/uploadPic/uploadPic",
"van-popup": "@vant/weapp/popup/index",
"van-picker": "@vant/weapp/picker/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index"
},
"navigationBarTitleText": "违章处理反馈"
}
@@ -0,0 +1,139 @@
/* pages/backlog/violationFeedback/violationFeedback.wxss */
.container {
height: 100vh;
padding-top: 2px;
box-sizing: border-box;
background: #EFF1F4;
overflow: hidden;
position: relative;
.content {
padding: 12px 8px 4px;
background: #fff;
.row {
width: 100%;
min-height: 36px;
padding: 8px 10px;
margin-bottom: 8px;
box-sizing: border-box;
border-radius: 4px;
border: 1px solid #E6EAF2;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
position: relative;
.label {
color: #2F3B50;
font-size: 14px;
}
.marker {
width: 100%;
margin-top: 8px;
color: #949CB5;
font-size: 14px;
}
.upload {
width: 100%;
margin-top: 8px;
.upload-btn {
width: 64px;
height: 64px;
background: #ECF1FF;
border-radius: 4px;
border: 1px dashed #4381FC;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
image {
width: 20px;
height: 20px;
margin: 16rpx 0 8rpx;
}
.val {
color: #4381FC;
font-size: 14px;
}
}
}
.select-box {
width: 70%;
display: flex;
align-items: center;
justify-content: flex-end;
.placeholder{
// color: #949CB5;
}
.arrow{
width: 0;
height: 0;
border-left: 13rpx solid transparent;
border-right: 13rpx solid transparent;
border-top: 15rpx solid #636B83;
margin-left: 18rpx;
}
}
}
.row-now {
width: 100%;
min-height: 36px;
padding: 8px 10px;
margin-bottom: 8px;
box-sizing: border-box;
border-radius: 4px;
border: 1px solid #E6EAF2;
display: flex;
align-items: center;
justify-content: space-between;
.label {
color: #2F3B50;
font-size: 14px;
}
.select {
width: 70%;
padding-right: 20px;
text-align: right;
position: relative;
.arrow {
width: 0;
height: 0;
border-top: 6px solid #636B83;
border-right: 6px solid transparent;
border-bottom: 6px solid transparent;
border-left: 6px solid transparent;
position: absolute;
top: 50%;
right: 4px;
transform: translateY(-2px);
}
}
}
}
.bottom {
width: 100%;
padding: 22px 10px;
background: #fff;
box-sizing: border-box;
border-radius: 8px 8px 0 0;
box-shadow: 0px -2px 12px 0px rgba(0,0,0,0.2);
position: absolute;
bottom: 0;
left: 0;
.btn-box {
width: 100%;
display: flex;
justify-content: space-between;
.btn {
width: 100%;
height: 40px;
line-height: 40px;
border-radius: 8px;
background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%);
color: #fff;
font-weight: bold;
text-align: center;
}
}
}
}
@@ -0,0 +1,255 @@
// pages/backlog/violationFeedback/violationFeedback.ts
import { putAction } from '../../../api/base';
const dayjs = require('dayjs');
Page({
/**
* 页面的初始数据
*/
data: {
options: [
{
name: '请选择',
type: ''
},
{
name: '已处理',
type: 1
},
{
name: '未处理',
type: 0
}
],
selectIndex: 0,
selectOption: {} as any,
detailInf: {} as any,
show: false,
currentDate: new Date().getTime(),
dateTimeStr: '请选择时间',
marker: '',
photoList: [] as any,
uploadUrl: 'api/vehicles/violation/upload',
showSelect: {} as any,
yesOrNoOptions: [
{
text: '已处理',
value: 1
},
{
text: '未处理',
value: 0
}
],
yesOrNoSelectIndex: -1
},
pickerChange(event: any) {
//下拉框切换是否展示
let fieldName: any = event.currentTarget.dataset.fieldname;
let data: any = { ...this.data };
if (fieldName == 'yesOrNoSelectShow') {
let { fieldindex } = event.currentTarget.dataset;
data.changeProjectIndex = fieldindex;
}
data.showSelect[fieldName] = true;
this.setData(data);
},
hidePicker() {
this.setData({
showSelect: {}
});
},
pickerConfirm(event: any) {
console.log(event);
//下拉框点击确认
let { fieldname, fieldindex } = event.currentTarget.dataset;
let detail = event.detail;
let data: any = { ...this.data };
if (fieldname == 'yesOrNoSelectIndex') {
data[fieldname] = detail.index;
} else {
data.params[fieldname] = detail.value.value;
data[fieldindex] = detail.index;
}
// if (data.params[fieldname]) {
// // delete data.requireObj[fieldname];
// data.requireObj[fieldname] = '';
// } else {
// data.requireObj[fieldname] = '请填写';
// }
console.log(this.data);
this.setData(data);
this.hidePicker();
},
bindPicker(e: any) {
console.log(e.detail.value);
let index = Number(e.detail.value);
this.setData({
selectIndex: index,
selectOption: this.data.options[index]
});
},
showDateTimePicker() {
this.setData({
show: true
});
},
dateOnInput(event: any) {
console.log(event.detail);
this.setData({
currentDate: event.detail,
dateTimeStr: dayjs(new Date(event.detail)).format('YYYY-MM-DD HH:mm'),
show: false
});
},
onClose() {
this.setData({
show: false
});
},
getMarker(e: any) {
this.setData({
marker: e.detail.value
});
},
returnPic(e: any) {
console.log(e.detail.photoList);
let urlList = [] as any;
e.detail.photoList.forEach((item: any) => {
urlList.push(item.fileUrl);
});
this.setData({
photoList: urlList
});
},
checkStr(str: string) {
let returnStr = '';
let spaceRegex = /^\S*$/;
let regex = /[!@#$%^&*?><|\\\\]/;
let tooLong = str.length > 32;
if (!spaceRegex.test(str)) {
returnStr = '不支持含有空格';
} else if (regex.test(str)) {
returnStr = '不支持特殊字符';
} else if (tooLong) {
returnStr = '输入长度不得超过32个字符';
} else {
returnStr = '';
}
return returnStr;
},
bindSend() {
let handleResult =
this.data.yesOrNoSelectIndex == -1
? ''
: this.data.yesOrNoOptions[this.data.yesOrNoSelectIndex].value;
let parms = Object.assign(this.data.detailInf, {
handleVoucher: this.data.photoList.join(','),
remark: this.data.marker,
handleTime: this.data.dateTimeStr,
handleResult: handleResult
});
if (this.data.yesOrNoSelectIndex == -1) {
wx.showToast({
title: '请选择处理结果',
icon: 'none'
});
return;
}
if (parms.handleTime == '请选择时间') {
wx.showToast({
title: '请选择处理时间',
icon: 'none'
});
return;
}
// 验证非必填
if (parms.remark) {
let msg = this.checkStr(parms.remark);
if (msg) {
wx.showToast({
title: '备注:' + msg,
icon: 'none'
});
return;
}
}
wx.showLoading({
title: '提交中',
icon: 'none'
});
putAction('api/vehicles/violation/edit', parms).then((res: any) => {
wx.hideLoading();
if (res.code == 200) {
console.log(res.result);
// setTimeout(() => {
// wx.navigateBack({ delta: 2 });
// }, 1500);
wx.navigateTo({
url: '../backlogFeedback/backlogFeedback',
fail: e => {
console.log(e);
}
});
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
// 接收传参
const eventChannel = this.getOpenerEventChannel();
eventChannel &&
eventChannel.on &&
eventChannel.on('eventName', (data: any) => {
console.log('接收参数', data);
this.setData({
detailInf: data
});
});
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
});
@@ -0,0 +1,67 @@
<!--pages/backlog/violationFeedback/violationFeedback.wxml-->
<view class="container">
<view class="content">
<view class="row">
<view class="label">处理结果</view>
<!-- <view class="select">
<picker bindchange="bindPicker" value="{{selectIndex}}" range-key="name" range="{{options}}">
<view class="picker project-select">
{{options[selectIndex].name}}
</view>
</picker>
</view> -->
<view class="select-box" data-fieldName="yesOrNoSelectShow" catch:tap="pickerChange">
<view wx:if="{{yesOrNoSelectIndex > -1}}">{{yesOrNoOptions[yesOrNoSelectIndex].text}}</view>
<view class="placeholder" wx:else>请选择</view>
<view class="arrow"></view>
</view>
</view>
<van-popup show="{{showSelect.yesOrNoSelectShow}}" position="bottom" bind:close="hidePicker">
<van-picker data-fieldname="yesOrNoSelectIndex" show-toolbar
columns="{{yesOrNoOptions}}" bind:confirm="pickerConfirm" bind:cancel="hidePicker">
</van-picker>
</van-popup>
<view class="row-now">
<view class="label">处理时间</view>
<view class="select" catch:tap="showDateTimePicker">
{{ dateTimeStr }}
<view class="arrow"></view>
</view>
</view>
<view class="row">
<view class="label">备注</view>
<view class="marker">
<textarea type="text"
placeholder="请输入备注"
style="height: 96rpx;"
placeholder-style="color: #949CB5; font-size: 28rpx; font-weight: 400;"
value="{{marker}}"
bindinput="getMarker"/>
</view>
</view>
<view class="row">
<view class="label">处理凭证</view>
<view class="upload">
<g-upload
id="g-upload"
maxLength="{{10}}"
picList="{{photoList}}"
uploadUrl="{{uploadUrl}}"
bind:returnPic="returnPic"></g-upload>
</view>
</view>
</view>
<view class="bottom">
<view class="btn-box">
<view class="btn" catch:tap="bindSend">提交</view>
</view>
</view>
<van-popup show="{{ show }}" position="bottom" bind:close="onClose">
<van-datetime-picker
type="datetime"
value="{{ currentDate }}"
bind:confirm="dateOnInput"
bind:cancel="onClose"
/>
</van-popup>
</view>