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,12 @@
{
"usingComponents": {
"van-picker": "@vant/weapp/picker/index",
"van-popup": "@vant/weapp/popup/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-search": "@vant/weapp/search/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,386 @@
/* pages/violationReporting/violationReporting.wxss */
page {
background-color: #EFF1F4;
}
.identificationBox {
background-color: #ffffff;
padding: 16rpx 0;
width: 100%;
padding: 16rpx 0;
position: relative;
.textarea {
height: 176rpx;
width: calc(100% - 56rpx);
border-radius: 16rpx;
border: 2rpx solid #E6EAF2;
margin: 0 16rpx 16rpx 16rpx;
padding: 12rpx;
font-size: 28rpx;
}
.analysisBtn {
position: relative;
width: calc(100% - 32rpx);
margin: 0 16rpx;
.tips {
color: red;
font-size: 25rpx;
}
}
.button {
width: 128rpx;
height: 64rpx;
background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%);
border-radius: 16rpx;
text-align: center;
line-height: 64rpx;
color: #fff;
// position: absolute;
// right: 16px;
&.disabled {
opacity: 0.35;
}
}
}
.flex-between {
display: flex;
align-items: center;
justify-content: space-between;
}
.flex-align {
display: flex;
align-items: center;
}
.flex-end {
display: flex;
align-items: center;
justify-content: flex-end;
}
.box {
background-color: #ffffff;
font-size: 28rpx;
padding: 28rpx 20rpx 0 20rpx;
&:not(:first-child) {
margin-top: 16rpx;
}
.row {
.left {
color: #333F53;
font-weight: bold;
.bg {
width: 8rpx;
height: 44rpx;
background: linear-gradient(180deg, #4E87FC 0%, #38B1FE 100%);
border-radius: 4rpx;
margin-right: 16rpx;
}
}
.right {
color: #2E3A4F;
.btn {
display: flex;
align-items: center;
image {
margin-right: 4px;
width: 20px;
height: 20px;
}
}
}
}
.info-item {
padding: 20rpx;
border-bottom: 2rpx solid #E6EAF2;
&.borderBottomNone {
border-bottom: none;
}
&.disabledItem {
background: #EFF1F4;
box-shadow: 0px 1px 0px 0px #E6EAF2;
.right {
color: #949CB5;
}
}
.left {
color: #2F3B50;
width: 40%;
.require {
color: #EA4955;
}
}
.right {
width: 60%;
text-align: right;
&.selectItem {
width: 100%;
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;
}
.van-radio-group {
display: flex;
van-radio {
margin-right: 8px;
}
}
}
.button-list {
display: flex;
.button-selected {
position: relative;
height: 34px;
width: 88px;
margin-left: 8px;
.bg {
width: 100%;
height: 100%;
position: absolute;
image {
border-radius: 4px;
width: 100%;
height: 100%;
}
}
.title {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
position: relative;
}
.disabled {
color: #93C0FF;
}
.selected {
color: #1677FF;
}
}
.button {
display: flex;
height: 32px;
width: 86px;
justify-content: center;
align-items: center;
border: 1px solid #C3CBE4;
margin-left: 8px;
border-radius: 4px;
}
}
.tips {
color: red;
text-align: right;
margin-top: 10rpx;
font-size: 25rpx;
}
.uploadBox {
margin-top: 16rpx;
}
.reset-btn {
background-color: #E9F2FF;
color: #4381FC;
width: 100px;
text-align: center;
border: 1px dashed #4381FC;
border-radius: 4px;
}
}
.template-info {
padding: 20rpx;
background-color: #ECEFF5;
.template-category {
font-size: 18px;
font-weight: bold;
margin-bottom: 8px;
}
.template-content {
width: 100%;
background-color: #fff;
.template-title {
background: #F8F9FB;
border-bottom: 2rpx solid #E6EAF2;
text-align: center;
padding: 3px 0;
font-weight: bold;
}
.template-item {
padding: 20rpx;
border-bottom: 2rpx solid #E6EAF2;
}
}
}
.vehicle-info {
background-color: #ECEFF5;
border: 1px #ECEFF5 solid;
border-radius: 6px;
.vehicle-title {
display: flex;
justify-content: space-around;
padding: 8rpx 0;
}
.vehicle-content {
background-color: #fff;
max-height: 273px;
overflow-y: auto;
.vehicle-item {
padding: 17rpx 16rpx 8rpx;
&:not(:last-child) {
border-bottom: 1px solid #ECEFF5;
}
.vehicle-item-info {
display: flex;
justify-content: space-between;
height: 20px;
margin-bottom: 8px;
}
.vehicle-item-remark {
border-radius: 4px;
border: 1px solid #4381FC;
height: 36px;
display: flex;
align-items: center;
padding: 8rpx 16rpx;
input {
width: 100%;
}
}
}
.left-item {
display: flex;
.cancel-icon {
width: 20px;
height: 20px;
margin-right: 16rpx;
}
}
.right-item {
margin-right: 8px;
.van-radio-group {
display: flex;
van-radio {
margin-right: 8px;
}
}
}
.tips {
color: red;
font-size: 25rpx;
text-align: right;
margin-top: 10rpx;
}
}
}
}
.pdb_20 {
padding-bottom: 20rpx;
}
.searchBox {
position: absolute;
width: 100%;
left: 0;
top: 80rpx;
z-index: 63;
}
.operateBtn {
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;
.submitBtn {
height: 80rpx;
background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%);
border-radius: 16rpx;
color: #FFFFFF;
line-height: 80rpx;
text-align: center;
}
}
.container {
height: calc(100vh - 100px);
overflow-y: auto;
}
.weui-input {
width: 100%;
height: 60px;
}
.isEdit{
background-color: #ECEFF5 !important;
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,600 @@
<view>
<view class="container">
<view class="box {{showBox.base ? '' : 'pdb_20'}}">
<view class="row flex-between">
<view class="left flex-align">
<view class="bg"></view>
<view>基本信息</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 wx:if="{{showBox.base}}">
<view class="info-item {{isEdit ? 'isEdit' : ''}}">
<view class="flex-between">
<view class="left flex-align">
<view class="require">*</view>
<view>项目</view>
</view>
<view class="right flex-align selectItem" data-fieldName="projectShow" catch:tap="pickerChange" wx:if="{{!isEdit}}">
<view wx:if="{{dictTextList.projectId_dictText}}">{{dictTextList.projectId_dictText}}</view>
<view class="placeholder" wx:else>请选择</view>
<view class="arrow"></view>
</view>
<view wx:else>{{dictTextList.projectId_dictText}}</view>
</view>
<view class="tips" wx:if="{{requireObj.baseInfo.projectId}}">{{requireObj.baseInfo.projectId}}</view>
</view>
<van-popup show="{{showList.projectShow}}" position="bottom" bind:close="hidePicker">
<view class="searchBox">
<van-search value="{{ projectSearchVal }}" placeholder="请输入项目" bind:search="filterProject" />
</view>
<van-picker data-fieldname="projectId" data-dicttext="projectId_dictText" show-toolbar columns="{{filterProjectList}}" bind:confirm="pickerConfirm" bind:cancel="hidePicker"></van-picker>
</van-popup>
<view class="info-item">
<view class="flex-between">
<view class="left flex-align">
<view class="require">*</view>
<view>回访方式</view>
</view>
<view class="right flex-align selectItem" data-fieldName="reviewTypeShow" catch:tap="pickerChange">
<view wx:if="{{dictTextList.reviewType_dictText}}">{{dictTextList.reviewType_dictText}}</view>
<view class="placeholder" wx:else>请选择</view>
<view class="arrow"></view>
</view>
</view>
<view class="tips" wx:if="{{requireObj.baseInfo.reviewType}}">{{requireObj.baseInfo.reviewType}}</view>
</view>
<van-popup show="{{showList.reviewTypeShow}}" position="bottom" bind:close="hidePicker">
<van-picker data-fieldname="reviewType" data-dicttext="reviewType_dictText" show-toolbar columns="{{reviewTypeList}}" bind:confirm="pickerConfirm" bind:cancel="hidePicker"></van-picker>
</van-popup>
<view class="info-item">
<view class="flex-between">
<view class="left flex-align">
<view class="require">*</view>
<view>回访时间</view>
</view>
<view class="right flex-align selectItem" data-fieldName="reviewTimeShow" catch:tap="pickerChange">
<view wx:if="{{params.reviewTime}}">{{params.reviewTime}}</view>
<view class="placeholder" wx:else>请选择</view>
<view class="arrow"></view>
</view>
</view>
<view class="tips" wx:if="{{requireObj.baseInfo.reviewTime}}">{{requireObj.baseInfo.reviewTime}}</view>
</view>
<van-popup show="{{showList.reviewTimeShow}}" position="bottom" bind:close="hidePicker">
<van-datetime-picker type="datetime" value="{{ dictTextList.reviewTimeTamp }}" data-fieldName="reviewTime" bind:cancel="hidePicker" bind:confirm="pickerConfirm" />
</van-popup>
<view class="info-item borderBottomNone">
<view class="flex-between">
<view class="left flex-align">
<view class="require">*</view>
<view>内容</view>
</view>
<view class="button-list">
<view class="button-selected">
<view class="bg">
<image src="../../../images/icon_select-disabled.png" mode="" />
</view>
<view class="title disabled">回访信息</view>
</view>
<view class="button-selected" data-fieldName="inspectionTask" catch:tap="selectContent" wx:if="{{contentItem.inspectionTask}}">
<view class="bg">
<image src="../../../images/icon_select.png" mode="" wx:if="{{!isEdit}}" />
<image src="../../../images/icon_select-disabled.png" mode="" wx:else />
</view>
<view class="title {{isEdit ? 'disabled' : 'selected'}}">车辆巡检</view>
</view>
<view class="button" data-fieldName="inspectionTask" catch:tap="selectContent" wx:if="{{!contentItem.inspectionTask}}">
<view class="title">车辆巡检</view>
</view>
<view class="button-selected" data-fieldName="opinion" catch:tap="selectContent" wx:if="{{contentItem.opinion}}">
<view class="bg">
<image src="../../../images/icon_select.png" mode="" wx:if="{{!isEdit}}" />
<image src="../../../images/icon_select-disabled.png" mode="" wx:else />
</view>
<view class="title {{isEdit ? 'disabled' : 'selected'}}">意见反馈</view>
</view>
<view class="button" data-fieldName="opinion" catch:tap="selectContent" wx:if="{{!contentItem.opinion}}">
<view class="title">意见反馈</view>
</view>
</view>
</view>
<view class="tips" wx:if="{{requireObj.director}}">{{requireObj.director}}</view>
</view>
</view>
</view>
<view class="box {{showBox.followInfo && !isEdit ? '' : 'pdb_20'}}">
<view class="row flex-between">
<view class="left flex-align">
<view class="bg"></view>
<view>回访信息</view>
</view>
<view class="right">
<view class="btn" wx:if="{{showBox.followInfo}}" data-fieldName="followInfo" catch:tap="showBoxInf">
<image src="../../../images/icon_up.png" mode="" />
<view class="val">收起</view>
</view>
<view class="btn" wx:if="{{!showBox.followInfo}}" data-fieldName="followInfo" catch:tap="showBoxInf">
<image src="../../../images/icon_down.png" mode="" />
<view class="val">展开</view>
</view>
</view>
</view>
<view wx:if="{{showBox.followInfo}}">
<view class="info-item {{isEdit ? 'isEdit' : ''}}">
<view class="flex-between">
<view class="left flex-align">
<view class="require">*</view>
<view>回访模板</view>
</view>
<view class="right flex-align selectItem" data-fieldName="customerFollowTemplateShow" catch:tap="pickerChange" wx:if="{{!isEdit}}">
<view wx:if="{{dictTextList.customerFollowTemplate_dictText}}">{{dictTextList.customerFollowTemplate_dictText}}</view>
<view class="placeholder" wx:else>请选择</view>
<view class="arrow"></view>
</view>
<view wx:else>{{dictTextList.customerFollowTemplate_dictText}}</view>
</view>
<view class="tips" wx:if="{{requireObj.baseInfo.templateId}}">{{requireObj.baseInfo.templateId}}</view>
</view>
<van-popup show="{{showList.customerFollowTemplateShow}}" position="bottom" bind:close="hidePicker">
<view class="searchBox">
<van-search value="{{ customerFollowTemplateSearchVal }}" placeholder="请输入模板" bind:search="filterCustomerFollowTemplate" />
</view>
<van-picker data-fieldname="templateId" data-dicttext="customerFollowTemplate_dictText" show-toolbar columns="{{filterCustomerFollowTemplateList}}" bind:confirm="pickerConfirm" bind:cancel="hidePicker"></van-picker>
</van-popup>
<view wx:if="{{customerFollowTemplatePartList.length > 0}}">
<view class="template-info" wx:for="{{customerFollowTemplatePartList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<view class="template-category">{{item[0].categoryName}}</view>
<view class="template-content" wx:for="{{item}}" wx:for-item="el" wx:for-index="idx" wx:key="idx">
<view class="template-title">{{el.followName}}</view>
<view class="info-item">
<view class="flex-between">
<view class="left flex-align">
<view class="require">*</view>
<view>满意度</view>
</view>
<view class="right flex-align selectItem" data-fieldName="pleasedStatusShow" catch:tap="pickerChange" data-index="{{index}}" data-idx="{{idx}}">
<view wx:if="{{el.pleasedStatus}}">{{el.pleasedStatus === '1' ? '满意' : '不满意'}}</view>
<view class="placeholder" wx:else>请选择</view>
<view class="arrow"></view>
</view>
</view>
</view>
<view class="info-item">
<view class="flex-between">
<view class="left flex-align">
<view>备注</view>
</view>
<view class="right" style="width: 80%;">
<textarea class="weui-input" style="height: 40px;" maxlength="200" placeholder="最大输入长度为200" data-texttype='textarea' data-fieldName="customerFollowTemplatePartList" data-index="{{index}}" data-idx="{{idx}}" bindinput="partListRemarkChange" value="{{el.remark}}" />
</view>
</view>
<view class="tips" wx:if="{{validateObj.baseInfo.partList[index][idx].remark}}">{{validateObj.baseInfo.partList[index][idx].remark}}</view>
</view>
</view>
</view>
<van-popup show="{{showList.pleasedStatusShow}}" position="bottom" bind:close="hidePicker">
<van-picker show-toolbar columns="{{pleasedStatusList}}" bind:confirm="pleasedStatusPickerConfirm" bind:cancel="hidePicker"></van-picker>
</van-popup>
</view>
<view wx:if="{{customerFollowTemplatePartList.length == 0}}">
<view class="template-info">请选择模板</view>
</view>
<view class="info-item">
<view class="flex-between">
<view class="left flex-align">
<view class="require">*</view>
<view>回访人</view>
</view>
<view class="right flex-align selectItem" data-fieldName="reviewUserShow" catch:tap="pickerChange">
<view wx:if="{{dictTextList.reviewUserId_dictText}}">{{dictTextList.reviewUserId_dictText}}</view>
<view class="placeholder" wx:else>请选择</view>
<view class="arrow"></view>
</view>
<van-popup show="{{showList.reviewUserShow}}" position="bottom" bind:close="hidePicker">
<view class="searchBox">
<van-search value="{{ reviewUserSearchVal }}" placeholder="请输入回访人" bind:search="filterReviewUser" />
</view>
<van-picker data-fieldname="reviewUserId" data-dicttext="reviewUserId_dictText" show-toolbar columns="{{filterReviewUserList}}" bind:confirm="pickerConfirm" bind:cancel="hidePicker"></van-picker>
</van-popup>
</view>
<view class="tips" wx:if="{{requireObj.baseInfo.reviewUserId}}">{{requireObj.baseInfo.reviewUserId}}</view>
</view>
<view class="info-item">
<view class="flex-between">
<view class="left flex-align">
<view class="require">*</view>
<view>回访结果</view>
</view>
<view class="right flex-align selectItem" data-fieldName="resultStatusShow" catch:tap="pickerChange">
<view wx:if="{{dictTextList.resultStatus_dictText}}">{{dictTextList.resultStatus_dictText}}</view>
<view class="placeholder" wx:else>请选择</view>
<view class="arrow"></view>
</view>
</view>
<view class="tips" wx:if="{{requireObj.baseInfo.resultStatus}}">{{requireObj.baseInfo.resultStatus}}</view>
</view>
<van-popup show="{{showList.resultStatusShow}}" position="bottom" bind:close="hidePicker">
<van-picker data-fieldname="resultStatus" data-dicttext="resultStatus_dictText" show-toolbar columns="{{isEdit ? opinionStatusList : resultStatusList}}" bind:confirm="pickerConfirm" bind:cancel="hidePicker"></van-picker>
</van-popup>
<view class="info-item">
<view class="flex-between">
<view class="left flex-align">
<view>备注</view>
</view>
<view class="right" style="width: 80%;">
<textarea class="weui-input" maxlength="500" placeholder="最大输入长度为500" data-fieldName="remark" data-require='norequire' data-texttype='textarea' bindinput="inputChange" value="{{params.remark}}" />
</view>
</view>
<view class="tips" wx:if="{{validateObj.baseInfo.remark}}">{{validateObj.baseInfo.remark}}</view>
</view>
<view class="info-item">
<view class="left flex-align">
<view>附件</view>
</view>
<view class="uploadBox">
<van-uploader max-count="10" data-list="baseInfoFileList" bind:after-read="fileAfterRead" file-list="{{baseInfoFileList}}" bind:delete="deleteFile" />
</view>
</view>
</view>
</view>
<view class="box {{showBox.inspectionInfo && !isEdit ? '' : 'pdb_20'}}" wx:if="{{contentItem.inspectionTask}}">
<view class="row flex-between">
<view class="left flex-align">
<view class="bg"></view>
<view>车辆巡检</view>
</view>
<view class="right">
<view class="btn" wx:if="{{showBox.inspectionInfo}}" data-fieldName="inspectionInfo" catch:tap="showBoxInf">
<image src="../../../images/icon_up.png" mode="" />
<view class="val">收起</view>
</view>
<view class="btn" wx:if="{{!showBox.inspectionInfo}}" data-fieldName="inspectionInfo" catch:tap="showBoxInf">
<image src="../../../images/icon_down.png" mode="" />
<view class="val">展开</view>
</view>
</view>
</view>
<view wx:if="{{showBox.inspectionInfo}}">
<view class="info-item" style="border: none;">
<view class="flex-between">
<view class="left flex-align">
<view>巡检车辆</view>
</view>
<view class="right" style="width: 160rpx;" wx:if="{{originVehicleList.length != vehicleList.length && !isEdit}}">
<view class="reset-btn" catch:tap="resetVehicle">重置数据</view>
</view>
</view>
</view>
<view class="vehicle-info" wx:if="{{vehicleList.length > 0}}">
<view class="vehicle-title">
<view>车辆</view>
<view>结果</view>
</view>
<view class="vehicle-content">
<view class="vehicle-item {{isEdit ? 'isEdit' : ''}}" wx:for="{{vehicleList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<view class="vehicle-item-info">
<view class="left-item">
<image class="cancel-icon" src="../../../images/cancel-icon.png" catch:tap="deleteVehicle" data-index="{{index}}"></image>
<view class="plateNumber">{{item.plateNumber}}</view>
</view>
<view class="right-item">
<van-radio-group value="{{item.isNormal}}" bind:change="vehicleOnChange" data-index="{{index}}" disabled="{{isEdit}}">
<van-radio name="1">正常</van-radio>
<van-radio name="0">异常</van-radio>
</van-radio-group>
</view>
</view>
<view class="vehicle-item-remark">
<!-- <input type="text" value="{{item.abnormalMsg}}" placeholder="请输入异常情况备注" bindinput="vehicleRemarkChange" data-index="{{index}}" /> -->
<textarea class="weui-input" style="height: 40px;" maxlength="200" placeholder="最大输入长度为200" data-index="{{index}}" bindinput="vehicleRemarkChange" value="{{item.abnormalMsg}}" disabled="{{isEdit}}" />
</view>
<view class="tips" wx:if="{{validateObj.inspectionTaskInfo.vehicles[index].remark}}">{{validateObj.inspectionTaskInfo.vehicles[index].remark}}</view>
</view>
</view>
</view>
<view class="template-info" wx:if="{{vehicleList.length == 0}}">暂无车辆数据</view>
<view class="info-item {{isEdit ? 'isEdit' : ''}}">
<view class="flex-between">
<view class="left flex-align">
<view class="require">*</view>
<view>巡检模板</view>
</view>
<view class="right flex-align selectItem" data-fieldName="inspectionTemplateShow" catch:tap="pickerChange" wx:if="{{!isEdit}}">
<view wx:if="{{dictTextList.inspectionTemplate_dictText}}">{{dictTextList.inspectionTemplate_dictText}}</view>
<view class="placeholder" wx:else>请选择</view>
<view class="arrow"></view>
</view>
<view wx:else>{{dictTextList.inspectionTemplate_dictText}}</view>
</view>
<view class="tips" wx:if="{{requireObj.inspectionTaskInfo.inspectionTemplateId}}">{{requireObj.inspectionTaskInfo.inspectionTemplateId}}</view>
</view>
<van-popup show="{{showList.inspectionTemplateShow}}" position="bottom" bind:close="hidePicker">
<view class="searchBox">
<van-search value="{{ inspectionTemplateSearchVal }}" placeholder="请输入模板" bind:search="filterCustomerFollowTemplate" />
</view>
<van-picker data-fieldname="inspectionTemplateId" data-dicttext="inspectionTemplate_dictText" data-type='inspectionTask' show-toolbar columns="{{filterInspectionTemplateList}}" bind:confirm="pickerConfirm" bind:cancel="hidePicker"></van-picker>
</van-popup>
<view wx:if="{{inspectionTemplatePartList.length > 0}}">
<view class="template-info" wx:for="{{inspectionTemplatePartList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<view class="template-category">{{item[0].name}}</view>
<view class="template-content {{isEdit ? 'isEdit' : ''}}" wx:for="{{item}}" wx:for-item="el" wx:for-index="idx" wx:key="idx">
<view class="template-title {{isEdit ? 'isEdit' : ''}}">{{el.content}}</view>
<view class="info-item">
<view class="flex-between">
<view class="left flex-align">
<view class="require">*</view>
<view>是否正常</view>
</view>
<view class="right flex-align selectItem">
<van-radio-group value="{{el.normal}}" bind:change="templateOnChange" data-index="{{index}}" data-idx="{{idx}}" disabled='{{isEdit}}'>
<van-radio name="1">是</van-radio>
<van-radio name="0">否</van-radio>
</van-radio-group>
</view>
</view>
</view>
<view class="info-item">
<view class="flex-between">
<view class="left flex-align">
<view>备注</view>
</view>
<view class="right" style="width: 80%;">
<textarea class="weui-input" style="height: 40px;" maxlength="200" placeholder="最大输入长度为200" data-texttype='textarea' data-fieldName="inspectionTemplatePartList" data-index="{{index}}" data-idx="{{idx}}" bindinput="partListRemarkChange" value="{{el.remark}}" disabled='{{isEdit}}' />
</view>
</view>
<view class="tips" wx:if="{{validateObj.inspectionTaskInfo.partList[index][idx].remark}}">{{validateObj.inspectionTaskInfo.partList[index][idx].remark}}</view>
</view>
</view>
</view>
</view>
<view wx:if="{{inspectionTemplatePartList.length == 0}}">
<view class="template-info">请选择模板</view>
</view>
<view class="info-item {{isEdit ? 'isEdit' : ''}}">
<view class="flex-between">
<view class="left flex-align">
<view class="require">*</view>
<view>巡检结果</view>
</view>
<view class="right flex-align selectItem" data-fieldName="inspectionResultShow" catch:tap="pickerChange" wx:if='{{!isEdit}}'>
<view wx:if="{{dictTextList.inspectionResult_dictText}}">{{dictTextList.inspectionResult_dictText}}</view>
<view class="placeholder" wx:else>请选择</view>
<view class="arrow"></view>
</view>
<view wx:else>{{dictTextList.inspectionResult_dictText}}</view>
</view>
<view class="tips" wx:if="{{requireObj.inspectionTaskInfo.inspectionResult}}">{{requireObj.inspectionTaskInfo.inspectionResult}}</view>
</view>
<van-popup show="{{showList.inspectionResultShow}}" position="bottom" bind:close="hidePicker">
<van-picker data-fieldname="inspectionResult" data-dicttext="inspectionResult_dictText" data-type="inspectionTask" show-toolbar columns="{{inspectionResultList}}" bind:confirm="pickerConfirm" bind:cancel="hidePicker"></van-picker>
</van-popup>
<view class="info-item {{isEdit ? 'isEdit' : ''}}">
<view class="flex-between">
<view class="left flex-align">
<view>备注</view>
</view>
<view class="right" style="width: 80%;">
<textarea class="weui-input" maxlength="500" placeholder="最大输入长度为500" data-fieldName="remark" data-type="inspectionTask" data-require='norequire' data-texttype='textarea' bindinput="inputChange" value="{{params.inspectionTask.remark}}" disabled="{{isEdit}}" />
</view>
</view>
<view class="tips" wx:if="{{validateObj.inspectionTaskInfo.remark}}">{{validateObj.inspectionTaskInfo.remark}}</view>
</view>
<view class="info-item {{isEdit ? 'isEdit' : ''}}">
<view class="left flex-align">
<view>附件</view>
</view>
<view class="uploadBox">
<van-uploader max-count="10" data-list="inspectionTaskFileList" data-type="inspectionTask" bind:after-read="fileAfterRead" file-list="{{inspectionTaskFileList}}" bind:delete="deleteFile" disabled='{{isEdit}}' deletable='{{!isEdit}}' />
</view>
</view>
</view>
</view>
<view class="box {{showBox.handleInfo && !isEdit ? '' : 'pdb_20'}}" wx:if="{{contentItem.handle}}">
<view class="row flex-between">
<view class="left flex-align">
<view class="bg"></view>
<view>异常处理</view>
</view>
<view class="right">
<view class="btn" wx:if="{{showBox.handleInfo}}" data-fieldName="handleInfo" catch:tap="showBoxInf">
<image src="../../../images/icon_up.png" mode="" />
<view class="val">收起</view>
</view>
<view class="btn" wx:if="{{!showBox.handleInfo}}" data-fieldName="handleInfo" catch:tap="showBoxInf">
<image src="../../../images/icon_down.png" mode="" />
<view class="val">展开</view>
</view>
</view>
</view>
<view wx:if="{{showBox.handleInfo}}">
<view class="info-item {{isEdit ? 'isEdit' : ''}}">
<view class="flex-between">
<view class="left flex-align">
<view class="require">*</view>
<view>处理方案</view>
</view>
<view class="right" style="width: 80%;">
<textarea class="weui-input" maxlength="500" placeholder="最大输入长度为500" data-fieldName="handlePlan" data-type="inspectionTask" data-texttype='textarea' bindinput="inputChange" value="{{params.inspectionTask.handlePlan}}" disabled='{{isEdit}}' />
</view>
</view>
<view class="tips" wx:if="{{requireObj.inspectionTaskInfo.handlePlan}}">{{requireObj.inspectionTaskInfo.handlePlan}}</view>
</view>
<view class="info-item {{isEdit ? 'isEdit' : ''}}">
<view class="flex-between">
<view class="left flex-align">
<view class="require">*</view>
<view>处理结果</view>
</view>
<view class="right flex-align selectItem" data-fieldName="handleTypeShow" catch:tap="pickerChange" wx:if="{{!isEdit}}">
<view wx:if="{{dictTextList.handleType_dictText}}">{{dictTextList.handleType_dictText}}</view>
<view class="placeholder" wx:else>请选择</view>
<view class="arrow"></view>
</view>
<view wx:else>{{dictTextList.handleType_dictText}}</view>
</view>
<view class="tips" wx:if="{{requireObj.inspectionTaskInfo.handleType}}">{{requireObj.inspectionTaskInfo.handleType}}</view>
</view>
<van-popup show="{{showList.handleTypeShow}}" position="bottom" bind:close="hidePicker">
<van-picker data-fieldname="handleType" data-dicttext="handleType_dictText" data-type="inspectionTask" show-toolbar columns="{{ resultStatusList}}" bind:confirm="pickerConfirm" bind:cancel="hidePicker"></van-picker>
</van-popup>
<view class="info-item {{isEdit ? 'isEdit' : ''}}">
<view class="flex-between">
<view class="left flex-align">
<view class="require">*</view>
<view>处理时间</view>
</view>
<view class="right flex-align selectItem" data-fieldName="handleTimeShow" catch:tap="pickerChange" wx:if="{{!isEdit}}">
<view wx:if="{{params.inspectionTask.handleTime}}">{{params.inspectionTask.handleTime}}</view>
<view class="placeholder" wx:else>请选择</view>
<view class="arrow"></view>
</view>
<view wx:else>{{params.inspectionTask.handleTime}}</view>
</view>
<view class="tips" wx:if="{{requireObj.inspectionTaskInfo.handleTime}}">{{requireObj.inspectionTaskInfo.handleTime}}</view>
</view>
<van-popup show="{{showList.handleTimeShow}}" position="bottom" bind:close="hidePicker">
<van-datetime-picker type="datetime" value="{{ dictTextList.handleTimeTamp }}" data-fieldName="handleTime" bind:cancel="hidePicker" bind:confirm="pickerConfirm" />
</van-popup>
</view>
</view>
<view class="box {{showBox.feedbackInfo && !isEdit ? '' : 'pdb_20'}}" wx:if="{{contentItem.opinion}}">
<view class="row flex-between">
<view class="left flex-align">
<view class="bg"></view>
<view>意见反馈</view>
</view>
<view class="right">
<view class="btn" wx:if="{{showBox.feedbackInfo}}" data-fieldName="feedbackInfo" catch:tap="showBoxInf">
<image src="../../../images/icon_up.png" mode="" />
<view class="val">收起</view>
</view>
<view class="btn" wx:if="{{!showBox.feedbackInfo}}" data-fieldName="feedbackInfo" catch:tap="showBoxInf">
<image src="../../../images/icon_down.png" mode="" />
<view class="val">展开</view>
</view>
</view>
</view>
<view wx:if="{{showBox.feedbackInfo}}">
<view class="info-item {{isEdit ? 'isEdit' : ''}}">
<view class="flex-between">
<view class="left flex-align">
<view class="require">*</view>
<view>意见标题</view>
</view>
<view class="right">
<input placeholder-style="color:#949CB5" data-fieldName="name" data-type='opinion' bindinput="inputChange" value="{{params.opinion.name}}" type="text" placeholder="请输入" style="width:100%;" disabled='{{isEdit}}' />
</view>
</view>
<view class="tips" wx:if="{{requireObj.opinionInfo.name}}">{{requireObj.opinionInfo.name}}</view>
</view>
<view class="info-item {{isEdit ? 'isEdit' : ''}}">
<view class="flex-between">
<view class="left flex-align">
<view class="require">*</view>
<view>意见分类</view>
</view>
<view class="right flex-align selectItem" data-fieldName="opinionTypeShow" catch:tap="pickerChange" wx:if="{{!isEdit}}">
<view wx:if="{{dictTextList.opinionType_dictText}}">{{dictTextList.opinionType_dictText}}</view>
<view class="placeholder" wx:else>请选择</view>
<view class="arrow"></view>
</view>
<view wx:else>{{dictTextList.opinionType_dictText}}</view>
</view>
<view class="tips" wx:if="{{requireObj.opinionInfo.opinionType}}">{{requireObj.opinionInfo.opinionType}}</view>
</view>
<van-popup show="{{showList.opinionTypeShow}}" position="bottom" bind:close="hidePicker">
<van-picker data-fieldname="opinionType" data-dicttext="opinionType_dictText" data-type="opinion" show-toolbar columns="{{opinionTypeList}}" bind:confirm="pickerConfirm" bind:cancel="hidePicker"></van-picker>
</van-popup>
<view class="info-item {{isEdit ? 'isEdit' : ''}}">
<view class="flex-between">
<view class="left flex-align">
<view class="require">*</view>
<view>提议人</view>
</view>
<view class="right">
<input placeholder-style="color:#949CB5" data-fieldName="proposeName" data-type='opinion' bindinput="inputChange" value="{{params.opinion.proposeName}}" type="text" placeholder="请输入" style="width:100%;" disabled='{{isEdit}}' />
</view>
</view>
<view class="tips" wx:if="{{requireObj.opinionInfo.proposeName}}">{{requireObj.opinionInfo.proposeName}}</view>
</view>
<view class="info-item {{isEdit ? 'isEdit' : ''}}">
<view class="flex-between">
<view class="left flex-align">
<view class="require">*</view>
<view>联系电话</view>
</view>
<view class="right">
<input placeholder-style="color:#949CB5" data-fieldName="phone" data-type='opinion' bindinput="inputChange" value="{{params.opinion.phone}}" type="number" placeholder="请输入" style="width:100%;" disabled='{{isEdit}}' />
</view>
</view>
<view class="tips" wx:if="{{requireObj.opinionInfo.phone}}">{{requireObj.opinionInfo.phone}}</view>
</view>
<view class="info-item {{isEdit ? 'isEdit' : ''}}">
<view class="flex-between">
<view class="left flex-align">
<view class="require">*</view>
<view>意见内容</view>
</view>
<view class="right">
<input placeholder-style="color:#949CB5" data-fieldName="content" data-type='opinion' bindinput="inputChange" value="{{params.opinion.content}}" type="text" placeholder="请输入" style="width:100%;" disabled='{{isEdit}}' />
</view>
</view>
<view class="tips" wx:if="{{requireObj.opinionInfo.content}}">{{requireObj.opinionInfo.content}}</view>
</view>
<view class="info-item {{isEdit ? 'isEdit' : ''}}">
<view class="flex-between">
<view class="left flex-align">
<view class="require">*</view>
<view>处理人</view>
</view>
<view class="right flex-align selectItem" data-fieldName="userShow" catch:tap="pickerChange" wx:if="{{!isEdit}}">
<view wx:if="{{dictTextList.handleId_dictText}}">{{dictTextList.handleId_dictText}}</view>
<view class="placeholder" wx:else>请选择</view>
<view class="arrow"></view>
</view>
<view wx:else>{{dictTextList.handleId_dictText}}</view>
</view>
<view class="tips" wx:if="{{requireObj.opinionInfo.handleId}}">{{requireObj.opinionInfo.handleId}}</view>
</view>
<van-popup show="{{showList.userShow}}" position="bottom" bind:close="hidePicker">
<view class="searchBox">
<van-search value="{{ userSearchVal }}" placeholder="请输入处理人" bind:search="filterUser" />
</view>
<van-picker data-fieldname="handleId" data-dicttext="handleId_dictText" data-type="opinion" show-toolbar columns="{{filterUserList}}" bind:confirm="pickerConfirm" bind:cancel="hidePicker"></van-picker>
</van-popup>
<view class="info-item {{isEdit ? 'isEdit' : ''}}">
<view class="flex-between">
<view class="left flex-align">
<view>备注</view>
</view>
<view class="right" style="width: 80%;">
<textarea class="weui-input" maxlength="500" placeholder="最大输入长度为500" data-fieldName="remark" data-type="opinion" data-require='norequire' data-texttype='textarea' bindinput="inputChange" value="{{params.opinion.remark}}" disabled='{{isEdit}}' />
</view>
</view>
<view class="tips" wx:if="{{validateObj.opinionInfo.remark}}">{{validateObj.opinionInfo.remark}}</view>
</view>
<view class="info-item {{isEdit ? 'isEdit' : ''}}">
<view class="left flex-align">
<view>附件</view>
</view>
<view class="uploadBox">
<van-uploader max-count="10" data-list="opinionFileList" data-type="opinion" bind:after-read="fileAfterRead" file-list="{{opinionFileList}}" bind:delete="deleteFile" disabled='{{isEdit}}' deletable='{{!isEdit}}' />
</view>
</view>
</view>
</view>
</view>
<view class="operateBtn">
<view catchtap="formSubmit" class="submitBtn">提交</view>
</view>
</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,131 @@
// pages/backlog/annualInspection/annualInspection.ts
import { getAction } from '../../../api/base';
Page({
/**
* 页面的初始数据
*/
data: {
tabActive: 0,
info: '' as any,
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: '../customerFollow/customerFollow',
success: function (res) {
// 通过eventChannel向被打开页面传送数据
wx.setStorageSync('customerFollowData', that.data.info.id);
},
fail: e => {
console.log(e);
}
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
const eventChannel = this.getOpenerEventChannel();
getApp().EventChannel = eventChannel;
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
let info = wx.getStorageSync('customerFollowData');
this.setData({
info: info
});
wx.removeStorageSync('customerFollowData');
// this.getDetailInf();
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
});
@@ -0,0 +1,141 @@
<!--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">{{info.projectId_dictText}}</view>
</view>
<view class="project-name">{{info.followType}}</view>
</view>
<view class="row">
<view class="time">计划回访时间:{{info.time ? info.time : '-'}}</view>
<view class="type-list">
<view class="type">{{info.followStatus}}</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>
<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,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "加油充电详情"
}
@@ -0,0 +1,199 @@
/* packageA/pages/refuelingCharging/RefuelingChargingDetail/RefuelingChargingDetail.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 {
margin-bottom: 4px;
color: #2E3A4F;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: space-between;
.title {
font-size: 30rpx;
font-weight: bold;
}
.time {
color: #858CA0;
}
.val {
display: flex;
align-items: center;
.type {
width: 104rpx;
height: 32rpx;
padding: 4rpx;
margin-left: 16rpx;
line-height: 32rpx;
background: linear-gradient(270deg, #4CDBAD 0%, #2FCBAB 100%);
border-radius: 2px;
color: #fff;
text-align: center;
}
.type-g {
background: linear-gradient(270deg, #A1A8BB 0%, #838EAA 100%);
}
.type-b {
background: #4381FC;
}
.type-bb {
background: #FFFFFF;
border-radius: 2px;
border: 1px solid #4F88FC;
color: #4381FC;
}
}
.status {
width: 104rpx;
color: #2E3A4F;
font-weight: bold;
text-align: center;
}
.status1 {
width: 104rpx;
color: #4381FC;
font-weight: bold;
text-align: center;
}
.prices {
color: #4381FC;
font-size: 14px;
// display: flex;
// align-items: flex-end;
.num {
font-size: 28px;
font-weight: bold;
display: inline-block;
}
}
}
}
.detail-container {
max-height: calc(100vh - 130px);
padding: 0px 8px 0px;
box-sizing: border-box;
overflow: hidden;
position: relative;
.content {
max-height: calc(100vh - 150px);
padding: 12px 10px;
// box-sizing: border-box;
border-radius: 8px;
background: #fff;
overflow-y: auto;
.title {
margin-bottom: 17px;
display: flex;
align-items: center;
.line {
width: 4px;
height: 22px;
background: linear-gradient(180deg, #4E87FC 0%, #38B1FE 100%);
border-radius: 2px;
}
.val {
margin-left: 8px;
font-size: 14px;
font-weight: bold;
color: #333F53;
}
}
.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;
}
}
}
}
}
}
.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;
}
}
}
}
.file{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #409EFF;
word-wrap: break-word;
word-break: break-all;
white-space: pre-line;
}
@@ -0,0 +1,105 @@
// packageA/pages/refuelingCharging/RefuelingChargingDetail/RefuelingChargingDetail.ts
Page({
/**
* 页面的初始数据
*/
data: {
item: {} as any,
attachmentUrlList: []
},
// 查看文件
checkFile(event: any) {
let url = event.currentTarget.dataset.url;
let type = url.split('.')[url.split('.').length - 1];
if (type == 'jpg' || type == 'jpeg' || type == 'png') {
wx.previewImage({
current: url, // 当前显示图片的http链接
urls: [url] // 需要预览的图片http链接列表
});
} else {
wx.showLoading({
title: '数据加载中'
});
wx.downloadFile({
// 示例 url,并非真实存在
url: url,
success: function (res) {
const filePath = res.tempFilePath;
wx.openDocument({
filePath: filePath,
showMenu: true,
success: function (res) {
wx.hideLoading();
},
fail: function () {
wx.hideLoading();
}
});
},
fail: function () {
wx.hideLoading();
}
});
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
// 接收传参
const eventChannel = this.getOpenerEventChannel();
eventChannel &&
eventChannel.on &&
eventChannel.on('eventName', (data: any) => {
let attachmentUrlList = [] as any;
if (data.attachmentUrl) {
attachmentUrlList = data.attachmentUrl.split(',').map((item: any) => {
return {
url: item,
name: item.split('/')[item.split('/').length - 1]
};
});
}
this.setData({
item: data,
attachmentUrlList: attachmentUrlList
});
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
});
@@ -0,0 +1,85 @@
<!--packageA/pages/refuelingCharging/RefuelingChargingDetail/RefuelingChargingDetail.wxml-->
<view class="container">
<view class="bg">
<image src="../../../../images/bg_page_blue.png" mode="" />
</view>
<view class="top">
<view class="row">
<view class="title">{{item.plateNumber ? item.plateNumber : '/'}}</view>
<view class="time">{{item.recordDate ? item.recordDate : '/'}}</view>
</view>
<view class="row">
<view class="val">
{{item.vehicleType_dictText ? item.vehicleType_dictText : '/'}}
</view>
<view class="prices">
¥<view class="num">{{item.totalPrice ? item.totalPrice : '0'}}</view>
</view>
</view>
</view>
<view class="detail-container">
<view class="content">
<view class="title">
<view class="line"></view>
<view class="val">记录详情</view>
</view>
<view class="row">
<view class="label">部门</view>
<view class="val">{{item.sysOrgCode_dictText ? item.sysOrgCode_dictText : '/'}}</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.oilCard ? item.oilCard : '/'}}</view>
</view>
<view class="row">
<view class="label">卡余额(元)</view>
<view class="val">{{item.oilCardBalance ? item.oilCardBalance : '/'}}</view>
</view>
<view class="row">
<view class="label">加油站</view>
<view class="val">{{item.oilStation ? item.oilStation : '/'}}</view>
</view>
<view class="row">
<view class="label">油品规格/充电类型</view>
<view class="val">{{item.oilType_dictText ? item.oilType_dictText : '/'}}</view>
</view>
<view class="row">
<view class="label">加油时里程</view>
<view class="val">{{item.mileage ? item.mileage : '/'}}</view>
</view>
<view class="row">
<view class="label">数量(升/度)</view>
<view class="val">{{item.amount ? item.amount : '/'}}</view>
</view>
<view class="row">
<view class="label">金额(元)</view>
<view class="val">{{item.totalPrice ? item.totalPrice : '/'}}</view>
</view>
<view class="row">
<view class="label">单价(元)</view>
<view class="val">{{item.price ? item.price : '/'}}</view>
</view>
<view class="row">
<view class="label">日期</view>
<view class="val">{{item.recordDate ? item.recordDate : '/'}}</view>
</view>
<view class="row">
<view class="label">备注</view>
<view class="val" style="max-width: 80%;">{{item.remark ? item.remark : '/'}}</view>
</view>
<view class="row">
<view class="label">附件</view>
<view class="val" wx:if="{{item.attachmentUrl}}" style="max-width: 80%;">
<view wx:for="{{attachmentUrlList}}" wx:key="index" wx:for-item="file" data-index="{{index}}" bindtap="previewImg">
<view catch:tap="checkFile" data-url="{{file.url}}" class="file">{{file.name}}</view>
</view>
</view>
<view wx:else class="val">/</view>
</view>
</view>
</view>
</view>
@@ -0,0 +1,10 @@
{
"usingComponents": {
"van-popup": "@vant/weapp/popup/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-empty": "@vant/weapp/empty/index",
"van-divider": "@vant/weapp/divider/index"
},
"enablePullDownRefresh": true,
"navigationBarTitleText": "充电加油"
}
@@ -0,0 +1,296 @@
/* packageA/pages/refuelingCharging/RefuelingChargingReporting/RefuelingChargingReporting.wxss */
.container {
height: 100vh;
background: #EFF1F4;
overflow: hidden;
position: relative;
.search-container {
padding: 10px;
background: #ffffff;
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: center;
>.number-plate, >.date, >.select-box {
width: calc((100% - 6px) / 2);
height: 36px;
padding: 8px 10px;
box-sizing: border-box;
border-radius: 4px;
border: 1px solid #E6EAF2;
display: flex;
align-items: center;
}
>.number-plate {
.icon {
width: 20px;
height: 20px;
margin-right: 8px;
image {
width: 100%;
height: 100%;
}
}
input {
flex: 1;
font-size: 14px;
}
}
.select-box {
display: flex;
align-items: center;
justify-content: space-between;
.left {
display: flex;
align-items: center;
justify-content: space-between;
}
.placeholder{
color: #949CB5;
}
.icon {
width: 16px;
height: 16px;
// margin-left: 8px;
margin-right: 8px;
image {
width: 100%;
height: 100%;
}
}
.arrow{
width: 0;
height: 0;
border-left: 13rpx solid transparent;
border-right: 13rpx solid transparent;
border-top: 15rpx solid #636B83;
margin-left: 18rpx;
}
.clear-btn {
width: 14px;
height: 14px;
// margin: 0 8px;
image {
width: 100%;
height: 100%;
display: block;
}
}
}
.date {
display: flex;
align-items: center;
justify-content: space-between;
.val {
font-size: 28rpx;
}
.placeholder {
color:#949CB5;
font-size: 28rpx;
}
.icon {
width: 16px;
height: 16px;
margin-left: 8px;
image {
width: 100%;
height: 100%;
}
}
}
}
.list-content {
.list {
// height: calc(100vh - 44px - 65px - 88px);
height: calc(100vh - 44px - 65px);
padding: 8px 0;
box-sizing: border-box;
// overflow-y: auto;
.scroll-view_H {
height: 100%;
// padding: 0 8px;
box-sizing: border-box;
}
.item {
padding: 12px 10px;
margin: 0 8px 8px;
background: #FFFFFF;
border-radius: 8px;
// box-shadow: 0 0 4px 0 rgba(0,0,0,.4);
.row {
margin-bottom: 4px;
color: #2E3A4F;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: space-between;
.title {
font-size: 30rpx;
font-weight: bold;
}
.time {
color: #858CA0;
}
.val {
display: flex;
align-items: center;
.type {
width: 104rpx;
height: 32rpx;
padding: 4rpx;
margin-left: 16rpx;
line-height: 32rpx;
background: linear-gradient(270deg, #4CDBAD 0%, #2FCBAB 100%);
border-radius: 2px;
color: #fff;
text-align: center;
}
.type-g {
background: linear-gradient(270deg, #A1A8BB 0%, #838EAA 100%);
}
.type-b {
background: #4381FC;
}
.type-bb {
background: #FFFFFF;
border-radius: 2px;
border: 1px solid #4F88FC;
color: #4381FC;
}
}
.status {
width: 104rpx;
color: #2E3A4F;
font-weight: bold;
text-align: center;
}
.status1 {
width: 104rpx;
color: #4381FC;
font-weight: bold;
text-align: center;
}
.prices {
color: #4381FC;
font-size: 14px;
// display: flex;
// align-items: flex-end;
.num {
font-size: 28px;
font-weight: bold;
display: inline-block;
}
}
}
}
}
}
.nodata {
text-align: center;
margin: 60px;
font-size: 26px;
}
.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;
}
}
}
}
// 时间选择器
.date-btn-box {
// background: #fff;
// border-radius: 4px 4px 0 0;
border-bottom: 2rpx solid #F1F1F1;
font-size: 30rpx;
display: flex;
justify-content: space-between;
align-items: center;
.btn {
padding: 20rpx 36rpx;
color: #888888;
}
.btn-confirm{
color: #3D7EEA;
}
}
.date-title {
padding: 20rpx 36rpx;
font-size: 36rpx;
color: #888888;
border-bottom: 2rpx solid #F1F1F1;
display: flex;
justify-content: space-evenly;
align-items: center;
.line {
width: 10px;
height: 1px;
margin: 0 14px;
background: #949CB5;
}
.date {
width: calc((100% - 10px - 28px) / 2);
height: 36px;
padding: 8px 10px;
box-sizing: border-box;
border-radius: 4px;
border: 1px solid #E6EAF2;
display: flex;
align-items: center;
.icon {
width: 16px;
height: 16px;
margin-left: 8px;
image {
width: 100%;
height: 100%;
display: block;
}
}
input {
flex: 1;
color: #2E3A4F;
font-size: 14px;
}
}
.select {
border: 1px solid #1677FF;
input {
color: #1677FF !important;
}
}
}
.picker-box {
width: 100%;
display: flex;
justify-content: space-between;
}
@@ -0,0 +1,395 @@
// packageA/pages/refuelingCharging/RefuelingChargingRecord/RefuelingChargingRecord.ts
import { getAction } from '../../../../api/base';
const dayjs = require('dayjs');
Page({
/**
* 页面的初始数据
*/
data: {
startDate: '',
endDate: '',
startDateStr: '',
endDateStr: '',
startDateTmp: new Date().getTime(),
endDateTmp: '',
selectDate: 'startDate',
showDateSelect: false,
dateList: {
years: [2023, 2024, 2025],
months: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
date: [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
]
},
dateValue: [0, 0, 0],
plateNumber: '',
showSelect: {
timeSelectShow: false
},
list: [],
current: 1,
isLast: false,
loading: false
},
changePlateNumber(e: any) {
console.log(e);
this.setData({
list: [],
current: 1,
isLast: false,
loading: false,
plateNumber: e.detail.value
});
this.getList();
},
getList() {
console.log(this.data);
let date = this.data.startDateStr.split('/').join('-');
// let date2 = this.data.endDateStr.split('/').join('-');
let parms = {
recordDate: date,
projectId: '',
plateNumber: this.data.plateNumber,
vehicleType: '',
pageNo: this.data.current,
pageSize: 10
};
wx.showLoading({
title: '加载中'
});
if (!this.data.loading) {
this.setData({
loading: true
});
}
getAction('api/gis/refuelChargeRecord/page', parms).then((res: any) => {
wx.hideLoading();
this.setData({
loading: false
});
if (res.code == 200) {
let data: any = { ...this.data };
data.list = data.list.concat(res.result.records);
console.log(data);
this.setData(data);
if (data.list.length == res.result.total) {
this.setData({
isLast: true
});
}
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
});
},
toDetail(e: any) {
wx.navigateTo({
url: '../RefuelingChargingDetail/RefuelingChargingDetail',
success: function (res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('eventName', {
...e.currentTarget.dataset.inf
});
},
fail: e => {
console.log(e);
}
});
},
eventReportAdd() {
// let that = this;
let url = '../RefuelingChargingReporting/RefuelingChargingReporting';
wx.navigateTo({
url: url,
success: function (res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('eventName', {
isAdd: true
});
},
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();
}
},
//下拉框相关----------
pickerChange(event: any) {
//下拉框切换是否展示
let fieldName: any = event.currentTarget.dataset.fieldname;
let data: any = { ...this.data };
data.showSelect[fieldName] = true;
this.setData(data);
},
hidePicker() {
let showSelect = this.data.showSelect;
showSelect = {
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 === 'startDate') {
data['startDateStr'] = dayjs(new Date(detail)).format('YYYY-MM-DD');
} 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();
this.setData({
list: [],
current: 1,
isLast: false,
loading: false
});
this.getList();
},
clearDate() {
this.setData({
startDateStr: '',
list: [],
current: 1,
isLast: false,
loading: false
});
this.getList();
},
// 下拉框相关----------end
// 日期相关--------------
showDate(e: any) {
// selectDate
let clickDate = null as any;
if (e.currentTarget.dataset.key == 'startDate') {
clickDate = this.data.startDateStr;
} else {
clickDate = this.data.endDateStr;
}
if (!clickDate) {
let year = new Date().getFullYear();
let mon =
new Date().getMonth() + 1 < 10
? '0' + (new Date().getMonth() + 1)
: new Date().getMonth() + 1;
let day =
new Date().getDate() < 10
? '0' + new Date().getDate()
: new Date().getDate();
clickDate = `${year}/${mon}/${day}`;
}
let y = this.data.dateList.years.findIndex(
(x: number) => x == Number(clickDate.split('/')[0])
);
let m = this.data.dateList.months.findIndex(
(x: number) => x == Number(clickDate.split('/')[1])
);
let d = this.data.dateList.date.findIndex(
(x: number) => x == Number(clickDate.split('/')[2])
);
// console.log(this.data.startDate.split('/'))
console.log([y, m, d]);
this.setData({
showDateSelect: true,
selectDate: e.currentTarget.dataset.key,
startDateTmp:
e.currentTarget.dataset.key == 'startDate'
? clickDate
: this.data.startDateStr,
endDateTmp:
e.currentTarget.dataset.key == 'endDate'
? clickDate
: this.data.endDateStr,
dateValue: [y, m, d]
});
},
hideDate() {
this.setData({
showDateSelect: false
});
},
changeSelectDate(e: any) {
this.setData({
selectDate: e.currentTarget.dataset.key
});
},
selectDate(e: any) {
console.log(e.detail.value);
let y: string | number = this.data.dateList.years[e.detail.value[0]];
let m: string | number = this.data.dateList.months[e.detail.value[1]];
let d: string | number = this.data.dateList.date[e.detail.value[2]];
y = y < 10 ? '0' + y : y;
m = m < 10 ? '0' + m : m;
d = d < 10 ? '0' + d : d;
if (this.data.selectDate == 'startDate') {
this.setData({
startDateTmp: `${y}/${m}/${d}`
});
} else {
this.setData({
endDateTmp: `${y}/${m}/${d}`
});
}
},
changeDate(e: any) {
console.log(
new Date(this.data.startDateTmp).getTime(),
new Date(this.data.endDateTmp).getTime()
);
if (
new Date(this.data.startDateTmp).getTime() >
new Date(this.data.endDateTmp).getTime()
) {
wx.showToast({
title: '结束时间不能早于开始时间',
icon: 'none'
});
return;
}
this.setData({
startDateStr: this.data.startDateTmp,
endDateStr: this.data.endDateTmp,
startDate: this.data.startDateTmp.slice(5, this.data.startDateTmp.length),
endDate: this.data.endDateTmp.slice(5, this.data.endDateTmp.length),
showDateSelect: false
});
this.getList();
},
// 日期初始化
initDate() {
let year = new Date().getFullYear();
let mon =
new Date().getMonth() + 1 < 10
? '0' + (new Date().getMonth() + 1)
: ((new Date().getMonth() + 1) as any);
let day =
new Date(year, mon, 0).getDate() < 10
? '0' + new Date(year, mon, 0).getDate()
: new Date(year, mon, 0).getDate();
let sday =
new Date(year, mon, 1).getDate() < 10
? '0' + new Date(year, mon, 1).getDate()
: new Date(year, mon, 1).getDate();
let years = [];
for (let i = -3; i < 6; i++) {
years.push(year + i);
}
this.setData({
dateList: {
years: years,
months: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
date: [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
]
},
dateValue: [0, 0, 0],
startDate: `${mon}/${sday}`,
endDate: `${mon}/${day}`,
startDateStr: `${year}/${mon}/${sday}`,
endDateStr: `${year}/${mon}/${day}`,
startDateTmp: `${year}/${mon}/${sday}`,
endDateTmp: `${year}/${mon}/${day}`
});
},
// 日期相关--------------end
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
// this.initDate();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.setData({
list: [],
current: 1,
isLast: false,
loading: false
});
this.getList();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
this.setData({
list: [],
current: 1,
isLast: false
});
this.getList();
// 手动控制回弹
wx.stopPullDownRefresh();
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
});
@@ -0,0 +1,124 @@
<!--packageA/pages/refuelingCharging/RefuelingChargingRecord/RefuelingChargingRecord.wxml-->
<view class="container">
<view class="search-container">
<view class="number-plate" catchtap="toSearch">
<view class="icon">
<image src="../../../../images/icon_search.png" mode=""/>
</view>
<input
type="text"
placeholder="搜索车辆"
placeholder-style="color:#949CB5; font-size: 28rpx; font-weight: 400;"
value="{{plateNumber}}"
confirm-type="search"
bindconfirm="changePlateNumber" />
</view>
<view class="select-box" data-fieldName="timeSelectShow" catch:tap="pickerChange">
<view class="left">
<view class="icon">
<image src="../../../../images/icon_cal.png" mode="" />
</view>
<view wx:if="{{startDateStr}}">{{startDateStr}}</view>
<view class="placeholder" wx:else>请选择日期</view>
</view>
<!-- <view class="arrow"></view> -->
<view class="clear-btn" data-fieldName="amount" catch:tap="clearDate">
<image src="../../../../images/icon_delete.png" mode=""/>
</view>
</view>
<van-popup show="{{showSelect.timeSelectShow}}" position="bottom" bind:close="hidePicker">
<van-datetime-picker type="date" value="{{ startDateTmp }}" data-fieldName="startDate" bind:cancel="hidePicker" bind:confirm="pickerConfirm" />
</van-popup>
<!-- 日期范围选择 -->
<!-- <view class="date" data-key="startDate" catchtap="showDate">
<view class="val" wx:if="{{startDate}}">{{startDate}} 至 {{endDate}}</view>
<view class="placeholder" wx:else>日期范围</view>
<view class="icon">
<image src="../../../../images/icon_cal.png" mode="" />
</view>
</view> -->
</view>
<view class="list-content">
<view class="list">
<scroll-view class="scroll-view_H" scroll-y="true" bindscrolltolower="lower" style="width: 100%">
<view class="item" wx:for="{{list}}" wx:key="index" data-inf="{{item}}" catchtap="toDetail">
<view class="row">
<view class="title">{{item.plateNumber ? item.plateNumber : '/'}}</view>
<view class="time">{{item.recordDate ? item.recordDate : '/'}}</view>
</view>
<view class="row">
<view class="val">
{{item.vehicleType_dictText ? item.vehicleType_dictText : '/'}}
</view>
<view class="prices">
¥<view class="num">{{item.totalPrice ? item.totalPrice : '/'}}</view>
</view>
</view>
</view>
<view class="is-last" wx:if="{{isLast && list.length > 0}}">
<van-divider contentPosition="center">已加载完全部数据</van-divider>
</view>
<view class="no-data" wx:if="{{list.length == 0}}">
<van-empty description="无数据" />
</view>
</scroll-view>
</view>
</view>
<view class="bottom">
<view class="btn-box">
<view class="btn" catch:tap="eventReportAdd">新增</view>
</view>
</view>
<!-- 日期范围选择 -->
<!-- <van-popup
show="{{ showDateSelect }}"
position="bottom"
custom-style="height: 50%;"
bind:click-overlay="hideDate"
>
<view style="background: #fff;border-radius: 4px 4px 0 0;overflow: hidden;">
<view class="date-btn-box">
<view class="btn btn-cancel" bindtap="hideDate">取消</view>
<view class="title">选择开始结束时间</view>
<view class="btn btn-confirm" bindtap="changeDate">确定</view>
</view>
<view class="date-title">
<view class="date {{selectDate == 'startDate' ? 'select' : ''}}" data-key="startDate" catchtap="changeSelectDate">
<input
type="text"
value="{{startDateTmp}}"
disabled="true"
bindinput="getPassword" />
<view class="icon">
<image src="../../../../images/icon_cal.png" mode=""/>
</view>
</view>
<view class="line"></view>
<view class="date {{selectDate == 'endDate' ? 'select' : ''}}" data-key="endDate" catchtap="changeSelectDate">
<input
type="text"
value="{{endDateTmp}}"
disabled="true"
bindinput="getPassword" />
<view class="icon">
<image src="../../../../images/icon_cal.png" mode=""/>
</view>
</view>
</view>
<view class="picker-box">
<picker-view data-key="dateRang" value="{{dateValue}}" indicator-style="height: 50px;" style="width: 100%; height: 400rpx;" bindchange="selectDate">
<picker-view-column>
<view style="line-height: 50px; text-align: center;" wx:for="{{dateList.years}}" wx:key="index">{{item}}年</view>
</picker-view-column>
<picker-view-column>
<view style="line-height: 50px; text-align: center;" wx:for="{{dateList.months}}" wx:key="index">{{item}}月</view>
</picker-view-column>
<picker-view-column>
<view style="line-height: 50px; text-align: center;" wx:for="{{dateList.date}}" wx:key="index">{{item}}日</view>
</picker-view-column>
</picker-view>
</view>
</view>
</van-popup> -->
</view>
@@ -0,0 +1,9 @@
{
"usingComponents": {
"van-picker": "@vant/weapp/picker/index",
"van-popup": "@vant/weapp/popup/index",
"van-uploader": "@vant/weapp/uploader/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index"
},
"navigationBarTitleText": "新增加油充电记录"
}
@@ -0,0 +1,361 @@
/* packageA/pages/refuelingCharging/RefuelingChargingReporting/RefuelingChargingReporting.wxss */
page {
height: 100vh;
background: #EFF1F4;
// overflow: hidden;
position: relative;
.container {
height: calc(100% - 56px);
overflow-y: auto;
.content {
background-color: #ffffff;
font-size: 28rpx;
padding:28rpx 20rpx;
margin-bottom: 16rpx;
.top {
margin-bottom: 10px;
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 6px;
border-bottom: 2rpx 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;
align-items: flex-start;
.left {
color: #2F3B50;
display: flex;
.require{
color: #EA4955;
}
}
.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;
box-sizing: border-box;
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;
}
.clear-btn {
width: 12px;
height: 12px;
margin: 0 4px;
image {
width: 100%;
height: 100%;
display: block;
}
}
.unit {
margin: 0 4px;
color: #636B83;
}
}
.address-box {
width: 100%;
display: flex;
align-items: center;
.val {
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.icon {
width: 16px;
height: 16px;
image {
width: 100%;
height: 100%;
margin-left: 0px;
display: block;
}
}
}
}
.r100 {
width: 100%;
max-width: 100%;
margin-top: 10px;
display: block;
text-align: left;
}
}
}
.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;
}
.no-flex {
display: block !important;
}
.box-g {
padding: 12px;
margin-bottom: 4px;
background: #ECEFF5;
border-radius: 4px;
.row {
.left {
color: #858CA0;
}
}
}
.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;
}
}
}
}
.date-btn-box {
// background: #fff;
// border-radius: 4px 4px 0 0;
border-bottom: 2rpx solid #F1F1F1;
font-size: 30rpx;
display: flex;
justify-content: space-between;
align-items: center;
.btn {
padding: 20rpx 36rpx;
color: #888888;
}
.btn-confirm{
color: #3D7EEA;
}
}
.popup-search-box {
width: 100%;
padding: 6px 12px;
box-sizing: border-box;
// border-top: 2rpx solid #F1F1F1;
border-bottom: 2rpx solid #F1F1F1;
.input-box {
width: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
input {
flex: 1;
}
.clear-btn {
width: 14px;
height: 14px;
margin: 0 8px;
image {
width: 100%;
height: 100%;
display: block;
}
}
}
}
.picker-box {
width: 100%;
display: flex;
justify-content: space-between;
}
.weui-input {
width: 100%;
height: 60px;
}
.tips {
color: #EA4955;
text-align: right;
}
@@ -0,0 +1,599 @@
// packageA/pages/refuelingCharging/RefuelingChargingReporting/RefuelingChargingReporting.ts
import { postAction, getAction, upload } from '../../../../api/base';
const dayjs = require('dayjs');
Page({
/**
* 页面的初始数据
*/
data: {
plateNumberListDefault: [] as any,
plateNumberList: [] as any,
plateNumberPickerIndex: -1,
oilTypeList: [] as any,
oilTypePickerIndex: -1,
showSelect: {
oilTypeSelectShow: false,
recordDateSelectShow: false
} as any,
requireObj: {
// id: '',
plateNumber: '',
oilType: '',
oilCard: '', //油卡
mileage: '', //加油充电时里程
amount: '', //数量
totalPrice: '', //金额
recordDate: '' // 日期
},
// 非必填
validateObj: {
driver: '', // 司机
oilStation: '', // 加油站
oilCardBalance: '', // 油卡余额
remark: '' // 备注
},
params: {
id: '',
sysOrgCode: '', //所属机构
projectId: '', //所属项目
vehicleId: '', //车辆id
vehicleModel: '', //车辆型号
plateNumber: '', //车牌号
vehicleType: '', //车辆种类
driver: '', //驾驶员
oilStation: '', //加油站
oilCardBalance: '', //油卡余额
oilType: '', //油品规格
oilCard: '', //油卡
mileage: '', //加油充电时里程
// "fuelType": "1", //燃料类型
amount: '', //数量
totalPrice: '', //金额
remark: '', //备注
attachmentUrl: '', //附件
recordDate: '' // 日期
} as any,
loading: false,
pvIndex: 0,
searchVal: '',
price: '—', // 单价
fileList: [], // 附件:
uploading: false, // 是否上传中
recordDateTimeTamp: new Date().getTime() // 日期标签
},
selectplateNumber(e: any) {
this.setData({
pvIndex: e.detail.value
});
},
//下拉框相关----------
pickerChange(event: any) {
//下拉框切换是否展示
let fieldName: any = event.currentTarget.dataset.fieldname;
let data: any = { ...this.data };
data.showSelect[fieldName] = true;
this.setData(data);
},
hidePicker() {
let showSelect = this.data.showSelect;
showSelect = {
oilTypeSelectShow: false,
recordDateSelectShow: 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 === 'plateNumber') {
console.log(this.data.pvIndex);
// data.params[fieldname] = this.data.pvIndex;
// data.params[fieldname] = detail.value.value;
// data[fieldindex] = detail.index;
fieldindex = this.data.pvIndex;
// data.params.fuelType = this.data.plateNumberList[fieldindex].fuelType; // 燃料类型
if (this.data.plateNumberList[fieldindex].oilCard)
data.params.oilCard = this.data.plateNumberList[fieldindex].oilCard; //油卡
data.params.sysOrgCode = this.data.plateNumberList[fieldindex].sysOrgCode; //所属机构
data.params.projectId = this.data.plateNumberList[fieldindex].projectId; //所属项目
data.params.vehicleId = this.data.plateNumberList[fieldindex].id; //车辆id
data.params.vehicleModel =
this.data.plateNumberList[fieldindex].vehicleModel; //车辆型号
data.params.plateNumber =
this.data.plateNumberList[fieldindex].plateNumber; //车牌号
data.params.vehicleType =
this.data.plateNumberList[fieldindex].vehicleType; //车辆种类
} else if (fieldname == 'recordDate') {
data.params[fieldname] = dayjs(new Date(detail)).format('YYYY-MM-DD');
data.recordDateTimeTamp = event.detail;
// data.requireObj[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] = '此项为必填项';
}
this.setData(data);
this.hidePicker();
},
// 下拉框相关----------end
// 输入框相关---------------
getInput(e: any) {
console.log(e);
let { fieldname, fieldindex, fieldkey } = e.currentTarget.dataset;
let detail = e.detail;
let data: any = { ...this.data };
if (
fieldname == 'amount' ||
fieldname == 'totalPrice' ||
fieldname == 'mileage' ||
fieldname == 'oilCardBalance'
) {
detail.value = detail.value.replace(/[^\d.]/g, ''); // 只能输入数字和.
detail.value = detail.value.replace(/^\./g, ''); //第一个字符不能是.
detail.value = detail.value.replace(/\.{2,}/g, '.'); // 不能连续输入.
detail.value = detail.value.replace(/(\.\d+)\./g, '$1'); // .后面不能再输入.
detail.value = detail.value.replace(/^0+(\d)/, '$1');
let reg: RegExp = /^\d+(\.\d{1,2})?$/; //小数部分不能大于2位
if (!detail.value && fieldname != 'oilCardBalance') {
data.requireObj[fieldname] = '此项为必填项';
} else if (!detail.value && fieldname == 'oilCardBalance')
data.requireObj[fieldname] = '';
if (detail.value > 999999) {
// data.params[fieldname] = 999999;
if (fieldname == 'oilCardBalance')
data.validateObj[fieldname] = '输入值上限为999999';
else data.requireObj[fieldname] = '输入值上限为999999';
data.params[fieldname] = detail.value;
} else if (!reg.test(detail.value) && detail.value) {
if (fieldname == 'oilCardBalance')
data.validateObj[fieldname] = '输入值最多保留两位小数';
else data.requireObj[fieldname] = '输入值最多保留两位小数';
data.params[fieldname] = detail.value;
} else {
data.params[fieldname] = detail.value;
if (fieldname == 'oilCardBalance') data.validateObj[fieldname] = '';
else data.requireObj[fieldname] = '';
}
if (data.params.amount && data.params.totalPrice) {
// 单价
let price = data.params.totalPrice / data.params.amount;
data.price = Math.floor(price * 100) / 100;
} else {
data.price = '—';
}
} else {
data.params[fieldname] = detail.value;
if (data.params[fieldname]) {
// delete data.requireObj[fieldname];
if (fieldname == 'oilCard')
data.requireObj[fieldname] = this.checkStr(data.params[fieldname]);
else {
if (fieldname == 'remark')
data.validateObj[fieldname] = this.checkStr(
data.params[fieldname],
1000
);
else
data.validateObj[fieldname] = this.checkStr(
data.params[fieldname],
64
);
}
} else {
if (
fieldname == 'driver' ||
fieldname == 'oilStation' ||
fieldname == 'oilCardBalance' ||
fieldname == 'remark'
) {
data.validateObj[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);
},
// 文件上传
fileAfterRead(event: any) {
const file = event.detail;
let index: any = event.detail.index;
let { list } = event.currentTarget.dataset;
let data: any = this.data;
let option = {
name: 'file',
filePath: event.detail.file.url
};
data[list][index] = {
status: 'uploading',
message: '上传中'
};
data.uploading = true;
this.setData(data);
upload('api/insuranceRecord/upload', option)
.then((res: any) => {
let tempData = JSON.parse(res.data);
if (!tempData.success) {
wx.showToast({
title: tempData.message,
icon: 'none'
});
data[list][index] = {
status: 'failed',
message: '上传失败'
};
data.uploading = false;
this.setData(data);
return;
}
data[list][index] = {
...file,
url: tempData.message,
status: 'done',
message: '上传完成'
};
console.log(data[list]);
data.uploading = false;
// 地址拼接
let attachmentUrl = data.params.attachmentUrl
? data.params.attachmentUrl + ',' + tempData.message
: tempData.message;
data.params.attachmentUrl = attachmentUrl;
this.setData(data);
})
.catch(err => {
data.uploading = false;
});
},
// 删除文件
deleteFile(event: any) {
let { list } = event.currentTarget.dataset;
let data: any = this.data;
let index = event.detail.index;
data[list].splice(index, 1);
data.params.attachmentUrl = data[list]
.map((item: any) => {
return item.url;
})
.join(',');
this.setData(data);
},
// 输入框相关---------------end
// 校验相关-----------------
checkStr(str: any, lenght = 32) {
let returnStr = '';
let spaceRegex = /^\S*$/ as any;
let regex = /[!@#$%^&*?><|\\\\]/ as any;
let tooLong = str.length > lenght;
if (!spaceRegex.test(str)) {
returnStr = '不支持含有空格';
} else if (regex.test(str)) {
returnStr = '不支持特殊字符';
} else if (tooLong) {
returnStr = `输入长度不得超过${lenght}个字符`;
} else {
returnStr = '';
}
return returnStr;
},
// 校验文件
checkFile() {
let { fileList } = this.data;
let result = true;
if (
fileList.some((item: any) => {
return item.status == 'failed';
})
)
result = false;
return result;
},
isStepReady() {
//校验基础信息
let isAllReady = true;
let temp: any = this.data.requireObj;
let validate: any = this.data.validateObj;
let params: any = this.data.params;
for (let key in temp) {
if (key == 'id') {
continue;
}
if (key == 'checkTime') {
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]$/ as any;
if (!timeRegex.test(params[key])) {
isAllReady = false;
temp[key] = '请填写正确的时间';
}
// temp[key] = temp[key] ? temp[key] : '请填写正确的时间';
} else if (key == 'amount' || key == 'totalPrice' || key == 'mileage') {
// 判断是否是正整数
let reg: RegExp = /^\d+(\.\d{1,2})?$/; //小数部分不能大于2位
// console.log(!regPos.test(params[key]));
// if (!regPos.test(params[key])) {
// isAllReady = false;
// temp[key] = '输入值为正数且最多保留两位小数';
// }
if (!params[key]) {
isAllReady = false;
temp[key] = '此项为必填项';
} else temp[key] = '';
if (params[key] > 999999) {
isAllReady = false;
temp[key] = '输入值上限为999999';
}
if (!reg.test(params[key]) && params[key]) {
isAllReady = false;
temp[key] = '输入值最多保留两位小数';
}
} else if (!params[key]) {
isAllReady = false;
temp[key] = temp[key] ? temp[key] : '此项为必填项';
} else {
temp[key] = this.checkStr(params[key]);
if (temp[key]) {
isAllReady = false;
}
}
}
// 非必填校验
for (let key in validate) {
if (key == 'oilCardBalance') {
let reg: RegExp = /^\d+(\.\d{1,2})?$/; //小数部分不能大于2位
if (params[key] > 999999) {
isAllReady = false;
validate[key] = '输入值上限为999999';
}
if (!reg.test(params[key]) && params[key]) {
isAllReady = false;
validate[key] = '输入值最多保留两位小数';
}
} else {
if (key == 'remark') validate[key] = this.checkStr(params[key], 1000);
else validate[key] = this.checkStr(params[key], 64);
if (validate[key]) {
isAllReady = false;
}
}
}
this.setData({
requireObj: temp,
validateObj: validate
});
return isAllReady;
},
// 校验相关-----------------end
filterPlateNumberList(e: any) {
let val = e.detail.value;
let arr = [] as any;
if (val) {
if (this.data.plateNumberListDefault.length > 0) {
arr = this.data.plateNumberListDefault.filter(
(item: any) => item.plateNumber.indexOf(val) != -1
);
}
} else {
arr = this.data.plateNumberListDefault;
}
this.setData({
searchVal: val,
plateNumberList: arr
});
},
restorePlateNumberList() {
this.setData({
searchVal: '',
plateNumberList: this.data.plateNumberListDefault
});
},
getplateNumberListByProjectId() {
let userInfo = wx.getStorageSync('userInfo');
console.log(userInfo);
let params = {
projectId: '',
plateNumber: ''
};
getAction('api/vehicle/getVehicleList', params).then((res: any) => {
if (res.code == 200) {
let tmp = [];
this.setData({
plateNumberListDefault: res.result ? res.result : [],
plateNumberList: res.result ? res.result : [],
plateNumberPickerIndex: -1
});
// if (this.data.params.plateNumber != '') {
// let i = res.result.findIndex(
// (x: any) => x.value == this.data.params.plateNumber
// );
// if (i == -1) {
// return;
// }
// this.setData({
// plateNumberPickerIndex: i
// });
// }
} 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 == 'oil_type') {
this.setData({
oilTypeList: res.result,
oilTypePickerIndex: -1
});
// if (this.data.params.oilType != '') {
// let i = res.result.findIndex(
// (x: any) => x.value == this.data.params.oilType
// );
// if (i == -1) {
// return;
// }
// this.setData({
// oilTypePickerIndex: i
// });
// }
} else {
}
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
});
},
formSubmit() {
if (this.data.loading) {
wx.showToast({
title: '信息保存中,请勿重复提交',
icon: 'none'
});
return;
}
// 校验文件是否正在上传
if (this.data.uploading) {
wx.showToast({
title: '文件上传中,请稍后',
icon: 'none'
});
return;
}
if (!this.isStepReady()) {
wx.showToast({
title: '请按照要求填写对应信息',
icon: 'none'
});
// 验证是否非空
return;
}
// 验证非必填
// if (this.data.params.remark) {
// let msg = this.checkStr(this.data.params.remark);
// if (msg) {
// if (msg == '输入长度不得超过32个字符') {
// msg =
// this.data.params.remark.length > 200
// ? '输入长度不得超过200个字符'
// : '';
// }
// wx.showToast({
// title: '备注:' + msg,
// icon: 'none'
// });
// return;
// }
// }
// 校验是否有错误文件
if (!this.checkFile()) {
wx.showToast({
title: '请删除错误文件',
icon: 'none'
});
return;
}
wx.showLoading({
title: '保存中'
});
this.setData({
loading: true
});
postAction('api/gis/refuelChargeRecord/add', this.data.params).then(
(res: any) => {
wx.hideLoading();
this.setData({
loading: false
});
if (res.code == 200) {
wx.showToast({
title: '保存成功',
icon: 'success'
});
wx.navigateBack({
delta: 1
});
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
}
);
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
this.getDictOptions('oil_type');
// 获取车辆下拉
this.getplateNumberListByProjectId();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
});
@@ -0,0 +1,234 @@
<!--packageA/pages/refuelingCharging/RefuelingChargingReporting/RefuelingChargingReporting.wxml-->
<view class="container">
<view class="content">
<view class="box">
<view class="box-g">
<view class="row row-w">
<view class="flex-between">
<view class="left">
<view class="require">*</view>车牌号
</view>
<view class="right">
<view class="select-box" data-fieldName="plateNumberSelectShow" catch:tap="pickerChange">
<view wx:if="{{params.plateNumber}}">{{params.plateNumber}}</view>
<view class="placeholder" wx:else>请选择</view>
<view class="arrow"></view>
</view>
<view class="tips" wx:if="{{requireObj.plateNumber != ''}}">{{requireObj.plateNumber}}</view>
</view>
</view>
</view>
<!-- 车牌号下拉选择 -->
<!-- <van-popup show="{{showSelect.plateNumberSelectShow}}" position="bottom" bind:close="hidePicker">
<van-picker data-fieldname="plateNumber" data-fieldindex="plateNumberPickerIndex" show-toolbar
columns="{{plateNumberList}}" bind:confirm="pickerConfirm" bind:cancel="hidePicker">
</van-picker>
</van-popup> -->
<van-popup show="{{ showSelect.plateNumberSelectShow }}" position="bottom" custom-style="height: 50%;" data-fieldname="plateNumber" data-fieldindex="plateNumberPickerIndex" bind:click-overlay="hidePicker">
<view style="background: #fff;border-radius: 4px 4px 0 0;overflow: hidden;">
<view class="date-btn-box">
<view class="btn btn-cancel" data-fieldname="plateNumber" data-fieldindex="plateNumberPickerIndex" bindtap="hidePicker">取消</view>
<view class="btn btn-confirm" data-fieldname="plateNumber" data-fieldindex="plateNumberPickerIndex" bindtap="pickerConfirm">确定</view>
</view>
<view class="popup-search-box">
<view class="input-box">
<input value="{{searchVal}}" placeholder="请输入车牌号" type="text" bindinput="filterPlateNumberList" />
<view class="clear-btn" catch:tap="restorePlateNumberList">
<image src="../../../../images/icon_delete.png" mode="" />
</view>
</view>
</view>
<view class="picker-box">
<picker-view data-key="dateRang" value="{{pvIndex}}" indicator-style="height: 50px;" style="width: 100%; height: 400rpx;" bindchange="selectplateNumber">
<picker-view-column>
<view style="line-height: 50px; text-align: center;" wx:for="{{plateNumberList}}" wx:key="index">{{item.plateNumber}}</view>
</picker-view-column>
</picker-view>
</view>
</view>
</van-popup>
<view class="row">
<view class="flex-between">
<view class="left">车辆类型</view>
<view class="right">{{params.vehicleModel ? params.vehicleModel : '/'}}</view>
</view>
</view>
</view>
<view class="row">
<view class="flex-between">
<view class="left">驾驶员</view>
<view style="width: 80%;text-align: right;">
<view class="input-box">
<input value="{{params.driver}}" placeholder="请输入" type="text" data-fieldName="driver" bindblur="getInput" />
</view>
<view class="tips" wx:if="{{validateObj.driver != ''}}">{{validateObj.driver}}</view>
</view>
</view>
</view>
<view class="row">
<view class="flex-between">
<view class="left">
<view class="require">*</view>卡号
</view>
<view style="width: 80%;text-align: right;">
<!-- {{params.oilCard ? params.oilCard : '—'}} -->
<view class="input-box">
<input value="{{params.oilCard}}" placeholder="请输入" type="text" data-fieldName="oilCard" bindblur="getInput" />
<!-- <view class="clear-btn" data-fieldName="oilCard" catch:tap="clearVal">
<image src="../../../../images/icon_delete.png" mode=""/>
</view> -->
</view>
<view class="tips" wx:if="{{requireObj.oilCard != ''}}">{{requireObj.oilCard}}</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.oilCardBalance}}" placeholder="请输入" type="digit" data-fieldName="oilCardBalance" bindblur="getInput" />
<view class="unit">元</view>
</view>
<view class="tips" wx:if="{{validateObj.oilCardBalance != ''}}">{{validateObj.oilCardBalance}}</view>
</view>
</view>
</view>
<view class="row">
<view class="flex-between">
<view class="left">加油站</view>
<view style="width: 80%;text-align: right;">
<view class="input-box">
<input value="{{params.oilStation}}" placeholder="请输入" type="text" data-fieldName="oilStation" bindblur="getInput" />
</view>
<view class="tips" wx:if="{{validateObj.oilStation != ''}}">{{validateObj.oilStation}}</view>
</view>
</view>
</view>
<view class="row">
<view class="flex-between">
<view class="left">
<view class="require">*</view>油品规格/充电类型
</view>
<view class="right">
<!-- {{item.projectId_dictText}} -->
<view class="select-box" data-fieldName="oilTypeSelectShow" catch:tap="pickerChange">
<view wx:if="{{params.oilType}}">{{oilTypeList[oilTypePickerIndex].text}}</view>
<view class="placeholder" wx:else>请选择</view>
<view class="arrow"></view>
</view>
<view class="tips" wx:if="{{requireObj.oilType != ''}}">{{requireObj.oilType}}</view>
</view>
</view>
<!-- 油品规格/充电类型下拉选择 -->
<van-popup show="{{showSelect.oilTypeSelectShow}}" position="bottom" bind:close="hidePicker">
<van-picker data-fieldname="oilType" data-fieldindex="oilTypePickerIndex" show-toolbar columns="{{oilTypeList}}" 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>加油/充电时里程(km
</view>
<view class="right">
<!-- {{item.mileage ? item.mileage : '/'}} -->
<view class="input-box">
<input type="digit" value="{{params.mileage}}" placeholder="请输入" data-fieldName="mileage" bindblur="getInput" />
<view class="unit">km</view>
<!-- <view class="clear-btn" data-fieldName="mileage" catch:tap="clearVal">
<image src="../../../../images/icon_delete.png" mode=""/>
</view> -->
</view>
<view class="tips" wx:if="{{requireObj.mileage != ''}}">{{requireObj.mileage}}</view>
</view>
</view>
</view>
<view class="box-g">
<view class="row row-w">
<view class="flex-between">
<view class="left">
<view class="require">*</view>数量(升/度)
</view>
<view class="right">
<!-- {{params.amount ? params.amount : '—'}} -->
<view class="input-box">
<input type="digit" value="{{params.amount}}" placeholder="请输入" data-fieldName="amount" bindblur="getInput" />
<view class="unit">升/度</view>
<!-- <view class="clear-btn" data-fieldName="amount" catch:tap="clearVal">
<image src="../../../../images/icon_delete.png" mode=""/>
</view> -->
</view>
<view class="tips" wx:if="{{requireObj.amount != ''}}">{{requireObj.amount}}</view>
</view>
</view>
</view>
<view class="row row-w">
<view class="flex-between">
<view class="left">
<view class="require">*</view>金额(元)
</view>
<view class="right">
<!-- {{params.totalPrice ? params.totalPrice : '—'}} -->
<view class="input-box">
<input type="digit" value="{{params.totalPrice}}" placeholder="请输入" data-fieldName="totalPrice" bindblur="getInput" />
<view class="unit">元</view>
<!-- <view class="clear-btn" data-fieldName="totalPrice" catch:tap="clearVal">
<image src="../../../../images/icon_delete.png" mode=""/>
</view> -->
</view>
<view class="tips" wx:if="{{requireObj.totalPrice != ''}}">{{requireObj.totalPrice}}</view>
</view>
</view>
</view>
<view class="row">
<view class="flex-between">
<view class="left">单价</view>
<view class="right">{{price}} 元</view>
</view>
</view>
</view>
<view class="row">
<view class="flex-between">
<view class="left">
<view class="require">*</view>日期
</view>
<view class="right">
<view class="select-box" data-fieldName="recordDateSelectShow" catch:tap="pickerChange">
<view wx:if="{{params.recordDate}}">{{params.recordDate}}</view>
<view class="placeholder" wx:else>请选择</view>
<view class="arrow"></view>
</view>
<view class="tips" wx:if="{{requireObj.recordDate != ''}}">{{requireObj.recordDate}}</view>
</view>
</view>
<!-- 日期选择 -->
<van-popup show="{{showSelect.recordDateSelectShow}}" position="bottom" bind:close="hidePicker">
<van-datetime-picker type="date" value="{{ recordDateTimeTamp }}" data-fieldName="recordDate" bind:cancel="hidePicker" bind:confirm="pickerConfirm" />
</van-popup>
</view>
<view class="row">
<view class="flex-between">
<view class="left">备注</view>
<view style="width: 80%;text-align: right;">
<textarea class="weui-input" maxlength="1000" placeholder="最大输入长度为1000" data-fieldName="remark" bindblur="getInput" value="{{params.remark}}" />
<view class="tips" wx:if="{{validateObj.remark != ''}}">{{validateObj.remark}}</view>
</view>
</view>
</view>
<view class="row">
<view class="flex-between">
<view class="left">附件</view>
<view class="right" style="max-width: 74%;">
<van-uploader max-count="10" data-list="fileList" bind:after-read="fileAfterRead" file-list="{{fileList}}" bind:delete="deleteFile" />
</view>
</view>
</view>
</view>
</view>
</view>
<view class="bottom">
<view class="btn-box">
<view class="btn" catch:tap="formSubmit">保存</view>
</view>
</view>