init
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-radio-group": "@vant/weapp/radio-group/index",
|
||||
"van-radio": "@vant/weapp/radio/index"
|
||||
},
|
||||
"navigationBarTitleText": "审批"
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
/* pages/vehicleMaintenance/maintainSend/maintainSend.wxss */
|
||||
.container {
|
||||
height: 100vh;
|
||||
padding-top: 2px;
|
||||
box-sizing: border-box;
|
||||
background: #EFF1F4;
|
||||
position: relative;
|
||||
|
||||
.row {
|
||||
margin-bottom: 8px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.label {
|
||||
color: #858CA0;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.val {
|
||||
color: #2E3A4F;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.item-container {
|
||||
height: calc(100vh - 72px);
|
||||
max-height: calc(100vh - 72px);
|
||||
overflow-y: auto;
|
||||
|
||||
// background-color: #bfa;
|
||||
.item {
|
||||
padding: 12px 10px;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
|
||||
&:not(:last-child) {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.require {
|
||||
&::after {
|
||||
content: '*';
|
||||
width: 6px;
|
||||
height: 100%;
|
||||
color: red;
|
||||
margin-left: 8px;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #333F53;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 22px;
|
||||
background: linear-gradient(180deg, #4E87FC 0%, #38B1FE 100%);
|
||||
border-radius: 2px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bottom {
|
||||
width: 100%;
|
||||
padding: 10px 8px 14px;
|
||||
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;
|
||||
|
||||
.row {
|
||||
width: 100%;
|
||||
height: 36px;
|
||||
padding: 8px 10px;
|
||||
margin-bottom: 8px;
|
||||
box-sizing: border-box;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #E6EAF2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.icon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-right: 8px;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
input {
|
||||
flex: 1;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-box {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.btn {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
background-color: #FFFFFF;
|
||||
line-height: 40px;
|
||||
border-radius: 8px;
|
||||
color: #2E3A4F;
|
||||
text-align: center;
|
||||
border: 1px solid #D6D6D6;
|
||||
}
|
||||
|
||||
.apply {
|
||||
background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%);
|
||||
color: #2E3A4F;
|
||||
color: #fff;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.weui-input {
|
||||
border-radius: 8px;
|
||||
border: 1px solid #E6EAF2;
|
||||
width: calc(100% - 16px);
|
||||
height: 83px;
|
||||
padding: 8px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.radio-group {
|
||||
margin-top: 16px;
|
||||
display: block;
|
||||
.van-radio-group {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
// pages/vehicleMaintenance/maintainSend/maintainSend.ts
|
||||
import { postAction } from '../../../api/base';
|
||||
const dayjs = require('dayjs');
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
checkIdea: '', // 报修内容
|
||||
upkeepObject: '' as any, // 维修单数据
|
||||
checkResult: '' as any, // 评审结果
|
||||
userInfo: '' as any, // 用户信息
|
||||
checkPeople: '' //审批人
|
||||
},
|
||||
|
||||
// 输入报修内容
|
||||
textareaInput(e: any) {
|
||||
this.setData({
|
||||
checkIdea: e.detail.value
|
||||
});
|
||||
},
|
||||
selectRadio(e: any) {
|
||||
this.setData({
|
||||
checkResult: e.currentTarget.dataset.inf
|
||||
});
|
||||
},
|
||||
// 提交申请
|
||||
submit() {
|
||||
if (this.data.checkResult) {
|
||||
if (this.data.checkResult == '2' && !this.data.checkIdea) {
|
||||
wx.showToast({
|
||||
title: '请填写审批意见',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
let params = {
|
||||
id: this.data.upkeepObject.id, //id
|
||||
checkFlag: this.data.checkResult, //审核状态 1-》通过, 2-》不通过
|
||||
upkeepPlan: {},
|
||||
currentUpkeepCheck: {
|
||||
checkResult: this.data.checkResult, //审核结果/维修结果
|
||||
checkPeople: this.data.userInfo.realname, //审批人
|
||||
checkIdea: this.data.checkIdea //审核意见
|
||||
}
|
||||
};
|
||||
wx.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
});
|
||||
postAction('api/vehicles/upkeepPlan/submitUpkeepPlan', params)
|
||||
.then((res: any) => {
|
||||
if (res.code == 200) {
|
||||
wx.hideLoading();
|
||||
wx.showToast({
|
||||
title: '提交成功',
|
||||
icon: 'none'
|
||||
});
|
||||
wx.setStorageSync('message', {
|
||||
checkPeople: this.data.userInfo.realname,
|
||||
date: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||
checkIdea: this.data.checkIdea,
|
||||
checkResult: this.data.checkResult,
|
||||
id: this.data.upkeepObject.id,
|
||||
auditStatus: 2,
|
||||
checkFlag: this.data.checkResult // 通过结果
|
||||
});
|
||||
wx.reLaunch({
|
||||
url: '../message/message',
|
||||
fail: e => {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
wx.hideLoading();
|
||||
wx.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((err: any) => {
|
||||
wx.hideLoading();
|
||||
wx.showToast({
|
||||
title: err.message,
|
||||
icon: 'none'
|
||||
});
|
||||
});
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '请选择审批结果',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
getInf() {
|
||||
// 获取信息
|
||||
let info = wx.getStorageSync('upkeepObject');
|
||||
wx.removeStorage({ key: 'upkeepObject' });
|
||||
let userInfo = wx.getStorageSync('userInfo');
|
||||
this.setData({
|
||||
upkeepObject: info,
|
||||
userInfo: userInfo,
|
||||
checkPeople: userInfo.realname
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad() {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
this.getInf();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
// 不放onReady 是因为有可能切出去然后状态改了得跳转到别的页面
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {}
|
||||
});
|
||||
@@ -0,0 +1,20 @@
|
||||
<view class="container">
|
||||
<view class="item-container">
|
||||
<view class="item">
|
||||
<view class="title require">审批结果</view>
|
||||
<van-radio-group class="radio-group">
|
||||
<van-radio name="1" style="margin-right: 16px;" catch:tap="selectRadio" data-inf='{{1}}'>通过</van-radio>
|
||||
<van-radio name="2" catch:tap="selectRadio" data-inf='{{2}}'>不通过</van-radio>
|
||||
</van-radio-group>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="title {{checkResult == 2 ? 'require' : ''}}">审批意见</view>
|
||||
<textarea class="weui-input" maxlength="200" placeholder="最大输入长度为200" value="{{checkIdea}}" bindblur="textareaInput" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view class="btn-box">
|
||||
<view class="btn apply" catch:tap="submit">提交审核</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
Reference in New Issue
Block a user