init
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-tab": "@vant/weapp/tab/index",
|
||||
"van-tabs": "@vant/weapp/tabs/index",
|
||||
"van-divider": "@vant/weapp/divider/index",
|
||||
"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"
|
||||
},
|
||||
"navigationBarTitleText": "保养详情"
|
||||
}
|
||||
@@ -0,0 +1,463 @@
|
||||
.container {
|
||||
height: 100vh;
|
||||
padding-top: 2px;
|
||||
box-sizing: border-box;
|
||||
background: #EFF1F4;
|
||||
position: relative;
|
||||
|
||||
>.bg {
|
||||
width: 100%;
|
||||
height: 250px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.top {
|
||||
margin: 8px 8px 10px;
|
||||
padding: 12px 10px;
|
||||
margin-bottom: 8px;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
position: relative;
|
||||
|
||||
.row:first-child {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.row {
|
||||
color: #2E3A4F;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.number-plate {
|
||||
display: flex;
|
||||
|
||||
.status {
|
||||
padding: 0 6px;
|
||||
margin-right: 4px;
|
||||
border-radius: 2px;
|
||||
color: #FFFFFF;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.status1 {
|
||||
background: linear-gradient(90deg, #0D92FF 0%, #38B1FE 100%);
|
||||
}
|
||||
|
||||
.status2 {
|
||||
background: linear-gradient(270deg, #4CDBAD 0%, #2FCBAB 100%);
|
||||
}
|
||||
|
||||
.status3 {
|
||||
background: linear-gradient(270deg, #A1A8BB 0%, #838EAA 100%);
|
||||
}
|
||||
|
||||
.val {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.project-name,
|
||||
.code {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 14px;
|
||||
color: #858CA0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.detail-container {
|
||||
padding: 0px 8px 0px;
|
||||
position: relative;
|
||||
|
||||
.tabs {
|
||||
display: flex;
|
||||
border-radius: 8px 8px 0 0;
|
||||
overflow: hidden;
|
||||
|
||||
.tabBg {
|
||||
background-color: #E2F3FE;
|
||||
}
|
||||
|
||||
.tab {
|
||||
width: 50%;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
color: #959595;
|
||||
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 {
|
||||
color: #4381FC;
|
||||
// background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.contentHeight1 {
|
||||
max-height: calc(100vh - 72px - 272px);
|
||||
}
|
||||
|
||||
.contentHeight3 {
|
||||
height: calc(100vh - 72px - 132px);
|
||||
max-height: calc(100vh - 72px - 132px);
|
||||
}
|
||||
|
||||
.content {
|
||||
overflow-y: auto;
|
||||
border-radius: 0px 0px 8px 8px;
|
||||
|
||||
.info {
|
||||
padding: 12px 8px;
|
||||
border-radius: 0px 0px 8px 8px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.check-info {
|
||||
margin-top: 8px;
|
||||
padding: 12px 8px;
|
||||
border-radius: 8px;
|
||||
background: #fff;
|
||||
|
||||
.check-title {
|
||||
color: #4381FC;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.check-one {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.margin-left8 {
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.check-idea {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.label {
|
||||
color: #858CA0;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.val {
|
||||
color: #2E3A4F;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.row {
|
||||
margin-bottom: 8px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
// align-items: center;
|
||||
.label {
|
||||
color: #858CA0;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.val {
|
||||
color: #2E3A4F;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.bold {
|
||||
color: #2F3B50;
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.bold-blue {
|
||||
color: #4381FC;
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.pic-box {
|
||||
max-width: 83%;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.check-title {
|
||||
width: 60px;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
line-height: 21px;
|
||||
}
|
||||
}
|
||||
|
||||
.repairList {
|
||||
max-height: 6000px;
|
||||
transition: max-height 0.6s ease-in-out;
|
||||
will-change: height;
|
||||
overflow: hidden;
|
||||
// transform-origin: top;
|
||||
// transform: scaleY(1);
|
||||
// transition: transform 0.3s ease-in;
|
||||
}
|
||||
|
||||
.repairList-hide {
|
||||
// transform-origin: top;
|
||||
// transform: scaleY(0);
|
||||
// transition: transform 0.3s ease-out;
|
||||
}
|
||||
|
||||
.repairList-item {
|
||||
padding: 8px 8px 2px 8px;
|
||||
background: #ECEFF5;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 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;
|
||||
}
|
||||
}
|
||||
|
||||
.select-row {
|
||||
&::before {
|
||||
content: '*';
|
||||
width: 6px;
|
||||
height: 100%;
|
||||
color: red;
|
||||
margin-right: 8px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
// width: calc((100% - 6px) / 2);
|
||||
picker {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
|
||||
.picker {
|
||||
width: 100%;
|
||||
height: 38px;
|
||||
// padding-left: 14px;
|
||||
box-sizing: border-box;
|
||||
// border: 1px solid #E6EAF2;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
display: flex;
|
||||
// justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.picker::after {
|
||||
content: '';
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top: 6px solid #636B83;
|
||||
border-right: 6px solid transparent;
|
||||
border-bottom: 6px solid transparent;
|
||||
border-left: 6px solid transparent;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 14px;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn-box {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.btn {
|
||||
width: calc(50% - 8px);
|
||||
height: 40px;
|
||||
background-color: #FFFFFF;
|
||||
line-height: 40px;
|
||||
border-radius: 8px;
|
||||
color: #2E3A4F;
|
||||
text-align: center;
|
||||
border: 1px solid #D6D6D6;
|
||||
}
|
||||
|
||||
.btn-full {
|
||||
width: calc(100% - 8px);
|
||||
}
|
||||
|
||||
.apply {
|
||||
background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%);
|
||||
color: #2E3A4F;
|
||||
color: #fff;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.picker view:first-child {
|
||||
word-break: break-all;
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 1;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
}
|
||||
|
||||
.label-width {
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.val-width {
|
||||
width: 73%;
|
||||
text-align: right;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.searchBox {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top: 80rpx;
|
||||
z-index: 63;
|
||||
}
|
||||
|
||||
.arrow {
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 11rpx solid transparent;
|
||||
border-right: 11rpx solid transparent;
|
||||
border-top: 13rpx solid #636B83;
|
||||
margin-left: 18rpx;
|
||||
}
|
||||
|
||||
.delete {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.requireItem {
|
||||
&::before {
|
||||
content: '*';
|
||||
width: 6px;
|
||||
height: 100%;
|
||||
color: red;
|
||||
margin-right: 4px;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
.picker {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.collapsed {
|
||||
display: flex;
|
||||
image {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-right: 4px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,431 @@
|
||||
import { getAction, postAction } from '../../../api/base';
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
tabActive: 0,
|
||||
currentflowStatus: 0,
|
||||
options: [] as any, // 维修厂数据
|
||||
filterOptions: [] as any, // 维修厂过滤后数据
|
||||
selectOption: null as any, // 选择的维修厂数据
|
||||
contact: '', // 联系人
|
||||
contactPhone: '', // 联系人电话
|
||||
upkeepObject: {} as any, // 保养单数据
|
||||
isCollapsed: false, // 默认为非折叠状态
|
||||
userInfo: {} as any, // 用户信息
|
||||
repairShopShow: false, // 控制维修厂选择弹窗
|
||||
repairShopSearchVal: '', // 维修厂查询过滤输入值
|
||||
userInf: ''
|
||||
},
|
||||
// 变更tab
|
||||
changeTab(e: any) {
|
||||
console.log(e.currentTarget.dataset.tab);
|
||||
this.setData({
|
||||
tabActive: e.currentTarget.dataset.tab
|
||||
});
|
||||
},
|
||||
// 收起保养明细
|
||||
collapse() {
|
||||
this.setData({
|
||||
isCollapsed: !this.data.isCollapsed
|
||||
});
|
||||
},
|
||||
getInf() {
|
||||
// 获取信息
|
||||
let info = wx.getStorageSync('selectMaintain');
|
||||
wx.removeStorage({ key: 'selectMaintain' });
|
||||
let userInfo = wx.getStorageSync('userInfo');
|
||||
this.setData({
|
||||
currentflowStatus: info.flowStatus,
|
||||
userInfo: userInfo
|
||||
});
|
||||
this.getUpkeepObject(info.id);
|
||||
},
|
||||
// 获取保养单数据
|
||||
getUpkeepObject(id: string) {
|
||||
if (id) {
|
||||
getAction(`api/vehicles/upkeepBill/getUpkeepObjectById?id=${id}`)
|
||||
.then((res: any) => {
|
||||
if (res.code == 200) {
|
||||
let data = res.result;
|
||||
if (data.upkeepOffer?.beforeUpkeepImgUrl)
|
||||
data.upkeepOffer.beforeUpkeepImgUrl =
|
||||
data.upkeepOffer.beforeUpkeepImgUrl.split(',');
|
||||
this.setData({
|
||||
upkeepObject: data
|
||||
});
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((err: any) => {
|
||||
wx.showToast({
|
||||
title: err.message,
|
||||
icon: 'none'
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
getContactPerson(e: any) {
|
||||
this.setData({
|
||||
contact: e.detail.value
|
||||
});
|
||||
},
|
||||
getTel(e: any) {
|
||||
this.setData({
|
||||
contactPhone: e.detail.value
|
||||
});
|
||||
},
|
||||
// 手机号校验方法
|
||||
checkMobilephone() {
|
||||
const regex = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/;
|
||||
if (this.data.contactPhone == '') {
|
||||
return true;
|
||||
} else {
|
||||
if (!regex.test(this.data.contactPhone)) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
},
|
||||
checkPhone() {
|
||||
let res = this.checkMobilephone();
|
||||
if (!res) {
|
||||
wx.showToast({
|
||||
title: '联系电话格式不正确',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
} else return true;
|
||||
},
|
||||
// 获取维修厂信息
|
||||
getRepairShop() {
|
||||
getAction('api/vehicles/repair/getRepairShop')
|
||||
.then((res: any) => {
|
||||
if (res.code == 200) {
|
||||
let data = [] as any;
|
||||
res.result.forEach((el: any) => {
|
||||
el.value = el.repairShop;
|
||||
el.text = el.repairShop_dictText;
|
||||
});
|
||||
data = res.result;
|
||||
this.setData({
|
||||
options: data,
|
||||
filterOptions: data
|
||||
});
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((err: any) => {
|
||||
wx.showToast({
|
||||
title: err.message,
|
||||
icon: 'none'
|
||||
});
|
||||
});
|
||||
},
|
||||
bindCancel() {
|
||||
// 作废
|
||||
wx.setStorageSync('upkeepObject', this.data.upkeepObject);
|
||||
wx.navigateTo({
|
||||
url: '../operation/cancel/cancel',
|
||||
fail: e => {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 返回
|
||||
goBack() {
|
||||
let pageList = getCurrentPages();
|
||||
if (pageList && pageList.length != 1) wx.navigateBack();
|
||||
else {
|
||||
if (this.data.userInfo.type == '1') {
|
||||
wx.reLaunch({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
} else if (this.data.userInfo.type == '2') {
|
||||
wx.reLaunch({
|
||||
url: '/pages/manufacturerIndex/manufacturerIndex'
|
||||
});
|
||||
} else if (this.data.userInfo.type == '3') {
|
||||
wx.reLaunch({
|
||||
url: '/pages/projectIndex/projectIndex'
|
||||
});
|
||||
} else if (this.data.userInfo.type == '4') {
|
||||
wx.reLaunch({
|
||||
url: '/pages/maintenanceIndex/maintenanceIndex'
|
||||
});
|
||||
} else {
|
||||
wx.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
bindSend() {
|
||||
// 派单
|
||||
if (!this.data.selectOption) {
|
||||
wx.showToast({
|
||||
title: '请选择维修厂',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
let res = this.checkPhone();
|
||||
if (!res) return;
|
||||
|
||||
let params = {
|
||||
id: this.data.upkeepObject.id, //id
|
||||
flowStatus: 2, //当前流程状态
|
||||
checkFlag: 1, //审核状态 1-》通过, 2-》不通过
|
||||
upkeepBill: {},
|
||||
upkeepAssign: {
|
||||
repairShop: this.data.selectOption.repairShop, //维修厂id
|
||||
contact: this.data.contact, //联系人
|
||||
contactPhone: this.data.contactPhone //联系电话
|
||||
},
|
||||
upkeepOffer: {},
|
||||
currentUpkeepCheck: {}
|
||||
};
|
||||
wx.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
});
|
||||
postAction('api/vehicles/upkeepBill/submitUpkeepObject', params)
|
||||
.then((res: any) => {
|
||||
if (res.code == 200) {
|
||||
wx.hideLoading();
|
||||
wx.showToast({
|
||||
title: '派单成功',
|
||||
icon: 'none'
|
||||
});
|
||||
wx.setStorageSync('message', {
|
||||
repairShop: this.data.selectOption.repairShop_dictText,
|
||||
contact: this.data.contact,
|
||||
phone: this.data.contactPhone,
|
||||
id: this.data.upkeepObject.id,
|
||||
flowStatus: 2
|
||||
});
|
||||
wx.redirectTo({
|
||||
url: '../operation/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'
|
||||
});
|
||||
});
|
||||
},
|
||||
// 去报价
|
||||
setOffer() {
|
||||
wx.setStorageSync('upkeepObject', this.data.upkeepObject);
|
||||
wx.navigateTo({
|
||||
url: '../operation/offer/offer',
|
||||
fail: e => {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 展示选择框
|
||||
pickerChange(event: any) {
|
||||
//下拉框切换是否展示
|
||||
let fieldName: any = event.currentTarget.dataset.fieldname;
|
||||
let data: any = { ...this.data };
|
||||
data[fieldName] = true;
|
||||
this.setData(data);
|
||||
},
|
||||
// 隐藏展示框
|
||||
hidePicker() {
|
||||
this.setData({
|
||||
repairShopShow: false
|
||||
});
|
||||
},
|
||||
// 选择器点击确认
|
||||
pickerConfirm(event: any) {
|
||||
let { fieldname } = event.currentTarget.dataset;
|
||||
let detail = event.detail;
|
||||
// 选择维修厂
|
||||
if (fieldname == 'repairShop') {
|
||||
this.setData({
|
||||
selectOption: detail.value,
|
||||
contact: detail.value.contact,
|
||||
contactPhone: detail.value.contactPhone
|
||||
});
|
||||
}
|
||||
this.hidePicker();
|
||||
},
|
||||
// 过滤维修厂
|
||||
filterRepairShop(event: any) {
|
||||
let list = [] as any;
|
||||
this.data.options.forEach((item: any) => {
|
||||
if (
|
||||
item.repairShop_dictText
|
||||
.toLowerCase()
|
||||
.indexOf(event.detail.toLowerCase()) >= 0
|
||||
) {
|
||||
list.push(item);
|
||||
}
|
||||
});
|
||||
this.setData({
|
||||
filterOptions: list,
|
||||
repairShopSearchVal: event.detail
|
||||
});
|
||||
},
|
||||
// 清空数据
|
||||
resetData(event: any) {
|
||||
let { fieldname } = event.currentTarget.dataset;
|
||||
if (fieldname == 'contact') {
|
||||
this.setData({
|
||||
contact: ''
|
||||
});
|
||||
} else if (fieldname == 'contactPhone') {
|
||||
this.setData({
|
||||
contactPhone: ''
|
||||
});
|
||||
}
|
||||
},
|
||||
// 图片预览
|
||||
showImage(event: any) {
|
||||
let { index, image } = event.currentTarget.dataset;
|
||||
let list = [] as any;
|
||||
if (image == 'attachmentList') {
|
||||
this.data.upkeepObject.upkeepBill.attachmentList.forEach((item: any) => {
|
||||
list.push(item.fileUrl);
|
||||
});
|
||||
} else if (image == 'beforeUpkeepImgUrl') {
|
||||
list = this.data.upkeepObject.upkeepOffer.beforeUpkeepImgUrl;
|
||||
} else if (image == 'attachmentUpkeepList') {
|
||||
this.data.upkeepObject.upkeepOffer.attachmentUpkeepList.forEach(
|
||||
(item: any) => {
|
||||
list.push(item.fileUrl);
|
||||
}
|
||||
);
|
||||
}
|
||||
wx.previewImage({
|
||||
current: list[index | 0], // 当前显示图片的http链接 默认urls[0]
|
||||
urls: list // 需要预览的图片http链接列表
|
||||
});
|
||||
},
|
||||
getUserInf() {
|
||||
this.setData({
|
||||
userInf: wx.getStorageSync('userInfo')
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad() {
|
||||
const eventChannel = this.getOpenerEventChannel();
|
||||
if (eventChannel && !getApp().EventChannel)
|
||||
getApp().EventChannel = eventChannel;
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
this.getRepairShop();
|
||||
this.getUserInf();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
// 不放onReady 是因为有可能切出去然后状态改了得跳转到别的页面
|
||||
this.getInf();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
let pages = getCurrentPages();
|
||||
let idx = null,
|
||||
num = 0;
|
||||
pages.forEach((item: any, index: number) => {
|
||||
if (
|
||||
item.route == 'pages/UpkeepBill/UpkeepBillRecord/UpkeepBillRecord' ||
|
||||
item.route == 'pages/backlog/backlogList/backlogList'
|
||||
)
|
||||
idx = index;
|
||||
});
|
||||
if (idx != null) num = pages.length - 2 - idx;
|
||||
console.log(idx, num);
|
||||
if (idx != null && num != 0) {
|
||||
wx.navigateBack({
|
||||
// delta: num,
|
||||
delta: 1,
|
||||
success: function (res) {
|
||||
// 通过eventChannel向被打开页面传送数据
|
||||
if (getApp().EventChannel.emit) getApp().EventChannel.emit('refresh');
|
||||
},
|
||||
fail: e => {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
} else if (idx == null) {
|
||||
// if (this.data.userInfo.type == '1') {
|
||||
// wx.reLaunch({
|
||||
// url: '/pages/index/index'
|
||||
// });
|
||||
// } else if (this.data.userInfo.type == '2') {
|
||||
// wx.reLaunch({
|
||||
// url: '/pages/manufacturerIndex/manufacturerIndex'
|
||||
// });
|
||||
// } else if (this.data.userInfo.type == '3') {
|
||||
// wx.reLaunch({
|
||||
// url: '/pages/projectIndex/projectIndex'
|
||||
// });
|
||||
// } else if (this.data.userInfo.type == '4') {
|
||||
// wx.reLaunch({
|
||||
// url: '/pages/maintenanceIndex/maintenanceIndex'
|
||||
// });
|
||||
// } else {
|
||||
// wx.reLaunch({
|
||||
// url: '/pages/login/login'
|
||||
// });
|
||||
// }
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {}
|
||||
});
|
||||
@@ -0,0 +1,279 @@
|
||||
<wxs module="module" src="../../module/module.wxs"></wxs>
|
||||
<view class="container">
|
||||
<view class="bg">
|
||||
<image src="../../../images/bg_page_blue.png" mode="" />
|
||||
</view>
|
||||
<view class="top">
|
||||
<view class="row">
|
||||
<view class="code">{{upkeepObject.upkeepBill.orderNo}}</view>
|
||||
<view class="number-plate">
|
||||
<view class="status status1">{{currentflowStatus == 2 ? '待派单' : '待报价'}}</view>
|
||||
<view class="val">{{upkeepObject.upkeepBill.plateNumber}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="project-name">{{upkeepObject.upkeepBill.projectId_dictText}}</view>
|
||||
<view class="time">{{upkeepObject.upkeepBill.predictTime}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail-container">
|
||||
<view class="tabs">
|
||||
<view class="tab {{tabActive == 0 ? 'active' : ''}} {{upkeepObject.upkeepOffer ? 'tabBg' : ''}}" data-tab="0" catch:tap="changeTab">
|
||||
<view class="bg" wx:if="{{tabActive == 0}}">
|
||||
<image src="../../../images/btn_l.png" mode="" />
|
||||
</view>
|
||||
<view class="value">基本信息</view>
|
||||
</view>
|
||||
<view class="tab {{tabActive == 1 ? 'active' : ''}} tabBg" data-tab="1" catch:tap="changeTab" wx:if="{{upkeepObject.upkeepOffer}}">
|
||||
<view class="bg" wx:if="{{tabActive == 1}}">
|
||||
<image src="../../../images/btn_r.png" mode="" />
|
||||
</view>
|
||||
<view class="value">报价信息</view>
|
||||
</view>
|
||||
<!-- <view class="tab {{tabActive == 0 ? 'active' : ''}}" data-tab="0" catch:tap="changeTab">基本信息</view>
|
||||
<view class="tab {{tabActive == 1 ? 'active' : ''}}" data-tab="1" catch:tap="changeTab" wx:if="{{upkeepObject.upkeepOffer}}">报价信息</view> -->
|
||||
</view>
|
||||
<view class="{{(currentflowStatus == 2 && userInfo.userType != 1)? 'contentHeight1' : ''}}{{(currentflowStatus == 3 || userInfo.userType == 1) ? 'contentHeight3' : ''}} content">
|
||||
<view class="info" wx:if="{{tabActive == 0}}">
|
||||
<view class="row">
|
||||
<view class="label label-width">车架号</view>
|
||||
<view class="val val-width">{{upkeepObject.upkeepBill.frameNumber || '/'}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label label-width">交车时间</view>
|
||||
<view class="val val-width">{{upkeepObject.upkeepBill.deliveryTime || '/'}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label label-width">车辆品牌</view>
|
||||
<view class="val val-width">{{upkeepObject.upkeepBill.vehicleBrand_dictText || '/'}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label label-width">车辆型号</view>
|
||||
<view class="val val-width">{{upkeepObject.upkeepBill.vehicleModel || '/'}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label label-width">车辆种类</view>
|
||||
<view class="val val-width">{{upkeepObject.upkeepBill.vehicleType_dictText || '/'}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label label-width">VIN码</view>
|
||||
<view class="val val-width">{{upkeepObject.upkeepBill.vinCode || '/'}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label label-width">发动机码</view>
|
||||
<view class="val val-width">{{upkeepObject.upkeepBill.engineNumber || '/'}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label label-width">提单时间</view>
|
||||
<view class="val val-width">{{upkeepObject.upkeepBill.createTime || '/'}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label label-width">上次保养时间</view>
|
||||
<view class="val val-width">{{upkeepObject.upkeepBill.lastTime || '/'}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label label-width">上次保养里程</view>
|
||||
<view class="val val-width">{{upkeepObject.upkeepBill.lastMileage || '/'}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label label-width">预计保养时间</view>
|
||||
<view class="val val-width">{{upkeepObject.upkeepBill.predictTime || '/'}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label label-width">预计保养里程</view>
|
||||
<view class="val val-width">{{upkeepObject.upkeepBill.predictMileage || '/'}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label label-width">保养内容</view>
|
||||
<view class="val val-width">{{upkeepObject.upkeepBill.content || '/'}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label">附件</view>
|
||||
<view class="pic-box" wx:if="{{upkeepObject.upkeepBill.attachmentList}}">
|
||||
<view class="item" wx:for="{{upkeepObject.upkeepBill.attachmentList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
|
||||
<image src="{{item.fileUrl}}" mode="" data-index="{{index}}" data-image="attachmentList" catch:tap="showImage" />
|
||||
</view>
|
||||
</view>
|
||||
<view wx:else class="val">/</view>
|
||||
</view>
|
||||
<view wx:if="{{currentflowStatus == 3}}">
|
||||
<van-divider></van-divider>
|
||||
<view class="row">
|
||||
<view class="label label-width">指派维修厂</view>
|
||||
<view class="val val-width">{{upkeepObject.upkeepAssign.repairShop_dictText || '/'}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label label-width">保养人</view>
|
||||
<view class="val val-width">{{upkeepObject.upkeepAssign.contact || '/'}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label label-width">联系电话</view>
|
||||
<view class="val val-width">{{upkeepObject.upkeepAssign.contactPhone || '/'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info" wx:if="{{tabActive == 1 && upkeepObject.upkeepOffer}}">
|
||||
<view class="row">
|
||||
<view class="label">保养明细({{upkeepObject.upkeepOffer.repairDetailList.length}})</view>
|
||||
<view class="val" bindtap="collapse">
|
||||
<view class="collapsed">
|
||||
<image wx:if="{{isCollapsed}}" src="../../../images/icon_down.png" mode="" />
|
||||
<image wx:else src="../../../images/icon_up.png" mode="" />
|
||||
<view>{{isCollapsed ? '展开' : '收起'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="repairList" style="{{isCollapsed ? 'max-height: 0px;' : ''}}">
|
||||
<view class="repairList-item" wx:for="{{upkeepObject.upkeepOffer.repairDetailList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
|
||||
<view class="row">
|
||||
<view class="label">保养分类</view>
|
||||
<view class="val">{{item.repairClass_dictText}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label label-width">保养内容</view>
|
||||
<view class="val val-width">{{item.repairContent ? item.repairContent : '/'}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label">数量</view>
|
||||
<view class="val">{{item.quantity}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label">材料单价</view>
|
||||
<view class="val">{{item.unitPrice}}元</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label">工时</view>
|
||||
<view class="val">{{item.workHours}}小时</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label">工时单价</view>
|
||||
<view class="val">{{item.workHoursCost}}元</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label" style="color: #2F3B50;">费用小计</view>
|
||||
<view class="val">
|
||||
<text class="bold">{{item.totalCost}}</text>
|
||||
<text style="margin-left: 8px;">元</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label">材料费</view>
|
||||
<view class="val">{{upkeepObject.upkeepOffer.materialCost}}元</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label">工时</view>
|
||||
<view class="val">{{upkeepObject.upkeepOffer.totalWorkHours}}小时</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label">工时费用</view>
|
||||
<view class="val">{{upkeepObject.upkeepOffer.totalWorkHoursCost}}元</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label" style="color: #2F3B50;">保养报价</view>
|
||||
<view class="val">
|
||||
<text class="bold-blue">{{upkeepObject.upkeepOffer.totaCost}}</text>
|
||||
<text style="margin-left: 8px;">元</text>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<van-divider></van-divider>
|
||||
<view class="row">
|
||||
<view class="label" style="width: 20%;">内容说明</view>
|
||||
<view class="val" style="width: 80%;text-align: right;">{{upkeepObject.upkeepOffer.offerContent}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label">保养前照片</view>
|
||||
<view class="pic-box" wx:if="{{upkeepObject.upkeepOffer.beforeUpkeepImgUrl}}">
|
||||
<view class="item" wx:for="{{upkeepObject.upkeepOffer.beforeUpkeepImgUrl}}" wx:for-item="item" wx:for-index="index" wx:key="index">
|
||||
<image src="{{item}}" mode="" data-index="{{index}}" data-image="beforeUpkeepImgUrl" catch:tap="showImage" />
|
||||
</view>
|
||||
</view>
|
||||
<view wx:else class="val">/</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label">单据附件</view>
|
||||
<view class="pic-box" wx:if="{{upkeepObject.upkeepOffer.attachmentUpkeepList}}">
|
||||
<view class="item" wx:for="{{upkeepObject.upkeepOffer.attachmentUpkeepList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
|
||||
<image src="{{item.fileUrl}}" mode="" data-index="{{index}}" data-image="attachmentUpkeepList" catch:tap="showImage" />
|
||||
</view>
|
||||
</view>
|
||||
<view wx:else class="val">/</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{upkeepObject.upkeepCheckList}}">
|
||||
<view class="check-info" wx:for="{{upkeepObject.upkeepCheckList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
|
||||
<view class="item">
|
||||
<view class="check-title" style="color: #4381FC;" wx:if="{{item.checkType == '1' && item.checkResult == '1'}}">审核结果:通过</view>
|
||||
<view class="check-title" style="color: red;" wx:if="{{item.checkType == '1' && item.checkResult == '2'}}">审核结果:不通过</view>
|
||||
<view class="check-title" style="color: #4381FC;" wx:if="{{item.checkType == '2' && item.checkResult == '1'}}">审批结果:通过</view>
|
||||
<view class="check-title" style="color: red;" wx:if="{{item.checkType == '2' && item.checkResult == '2'}}">审批结果:不通过</view>
|
||||
<view class="check-title" style="color: #4381FC;" wx:if="{{item.checkType == '5' && item.checkResult == '1'}}">复核结果:通过</view>
|
||||
<view class="check-title" style="color: red;" wx:if="{{item.checkType == '5' && item.checkResult == '2'}}">复核结果:不通过</view>
|
||||
<view class="check-one">
|
||||
<view class="check-operator">
|
||||
<text class="label">{{item.checkPeopleType_dictText}}</text>
|
||||
<text class="val margin-left8">{{item.checkPeople ? item.checkPeople : '/'}}</text>
|
||||
</view>
|
||||
<view class="check-time">
|
||||
<text class="label" wx:if="{{item.checkType == '1'}}">审核时间</text>
|
||||
<text class="label" wx:if="{{item.checkType == '2'}}">审批时间</text>
|
||||
<text class="label" wx:if="{{item.checkType == '5'}}">复核时间</text>
|
||||
<text class="label" wx:if="{{!item.checkType}}">操作时间</text>
|
||||
<text class="val margin-left8">{{item.checkTime ? item.checkTime : '/'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="check-idea">
|
||||
<text class="label" wx:if="{{item.checkType == '1'}}">审核意见</text>
|
||||
<text class="label" wx:if="{{item.checkType == '2'}}">审批意见</text>
|
||||
<text class="label" wx:if="{{item.checkType == '5'}}">复核意见</text>
|
||||
<text class="val" style="width: 81%;word-break: break-all;" wx:if="{{item.checkType}}">{{item.checkIdea ? item.checkIdea : '/'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view wx:if="{{currentflowStatus == 2 && userInfo.userType != 1}}">
|
||||
<view class="row select-row" data-fieldName="repairShopShow" catch:tap="pickerChange">
|
||||
<view class="picker">
|
||||
<view style="color: #aaa;font-size: 14px;" wx:if="{{!selectOption}}">请选择维修厂</view>
|
||||
<view style="font-size: 14px;" wx:else>{{selectOption.repairShop_dictText}}</view>
|
||||
<view class="arrow"></view>
|
||||
</view>
|
||||
</view>
|
||||
<van-popup show="{{repairShopShow}}" position="bottom" bind:close="hidePicker">
|
||||
<view class="searchBox">
|
||||
<van-search value="{{ repairShopSearchVal }}" placeholder="请输入维修厂名" bind:search="filterRepairShop" />
|
||||
</view>
|
||||
<van-picker data-fieldname="repairShop" show-toolbar columns="{{filterOptions}}" bind:confirm="pickerConfirm" bind:cancel="hidePicker">
|
||||
</van-picker>
|
||||
</van-popup>
|
||||
<view class="row">
|
||||
<view class="icon">
|
||||
<image src="../../../images/icon_contact.png" mode="" />
|
||||
</view>
|
||||
<input type="text" placeholder="请输入联系人" placeholder-style="color:#949CB5; font-size: 28rpx; font-weight: 400;" value="{{contact}}" bindinput="getContactPerson" />
|
||||
<image src="../../../images/icon_delete.png" mode="" class="delete" data-fieldName="contact" catch:tap="resetData" />
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="icon">
|
||||
<image src="../../../images/icon_phone.png" mode="" />
|
||||
</view>
|
||||
<input type="number" placeholder="请输入联系号码" placeholder-style="color:#949CB5; font-size: 28rpx; font-weight: 400;" value="{{contactPhone}}" bindinput="getTel" bindblur="checkPhone" />
|
||||
<image src="../../../images/icon_delete.png" mode="" class="delete" data-fieldName="contactPhone" catch:tap="resetData" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn-box">
|
||||
<view class="btn cancel" catch:tap="bindCancel" wx:if="{{module.buttonPermissions(userInf.auth,'UpkeepBill:cancel')}}">作废</view>
|
||||
<view class="btn cancel {{((!module.buttonPermissions(userInf.auth,'UpkeepBill:send') && currentflowStatus == 2) || (!module.buttonPermissions(userInf.auth,'UpkeepBill:offer') && currentflowStatus == 3)) ? 'btn-full' : ''}}" catch:tap="goBack" wx:else>返回</view>
|
||||
<view class="btn apply" catch:tap="bindSend" wx:if="{{currentflowStatus == 2 && module.buttonPermissions(userInf.auth,'UpkeepBill:send')}}">派单</view>
|
||||
<view class="btn apply" wx:elif="{{currentflowStatus == 3 && !upkeepObject.upkeepOffer && module.buttonPermissions(userInf.auth,'UpkeepBill:offer')}}" catch:tap="setOffer">去报价</view>
|
||||
<view class="btn apply" wx:elif="{{currentflowStatus == 3 && upkeepObject.upkeepOffer && module.buttonPermissions(userInf.auth,'UpkeepBill:offer')}}" catch:tap="setOffer">重新报价</view>
|
||||
<view class="btn cancel" catch:tap="goBack" wx:elif="{{module.buttonPermissions(userInf.auth,'UpkeepBill:cancel')}}">返回</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
Reference in New Issue
Block a user