This commit is contained in:
PQZ 2024-11-05 18:35:24 +08:00
parent d4e00a1d13
commit f7bf45e921

View File

@ -138,6 +138,96 @@
</view> </view>
</template> </template>
</view> </view>
<view class="card cardInfo userCard">
<template>
<view class="userTitle">工单信息</view>
<view class="userContainer">
<view style="display: flex;align-items: center">
<view class="infoItem" style="flex: 1">
<text class="label">进场时间</text>
<picker
mode="date"
:value="formData.inTime"
start="2020-01-01"
end="2030-12-31"
@change="bindDateChange1">
<view style="margin-left: 10rpx">
{{ formData.inTime}}
</view>
</picker>
</view>
<view class="infoItem" style="flex: 1">
<text class="label">预计完工</text>
<picker
mode="date"
:value="formData.outTime"
start="2020-01-01"
end="2030-12-31"
@change="bindDateChange2">
<view style="margin-left: 10rpx">
{{ formData.outTime}}
</view>
</picker>
</view>
</view>
<view style="display: flex;align-items: center">
<view class="infoItem" style="flex: 1">
<text class="label">表显里程</text>
<input type="text" style="text-align: left" v-model="formData.mileageTraveled" placeholder="请填写表显里程"/>
</view>
<view class="infoItem" style="flex: 1">
<text class="label">三包单位</text>
<input type="text" style="text-align: left" v-model="formData.threePackUnits" placeholder="请填写三包单位"/>
</view>
</view>
<view style="display: flex;align-items: center">
<view class="infoItem" style="flex: 1">
<text class="label">保险名称</text>
<input type="text" style="text-align: left" v-model="formData.insuranceName" placeholder="请填写保险名称"/>
</view>
<view class="infoItem" style="flex: 1">
<text class="label">管理费</text>
<input type="text" style="text-align: left" v-model="formData.managerMoney" placeholder="请填写管理费"/>
</view>
</view>
<view style="display: flex;align-items: center">
<view class="infoItem" style="flex: 1">
<text class="label">救援费</text>
<input type="text" style="text-align: left" v-model="formData.rescueMoney" placeholder="请填写救援费"/>
</view>
<view class="infoItem" style="flex: 1">
<text class="label">三包费</text>
<input type="text" style="text-align: left" v-model="formData.threePackMoney" placeholder="请填写救援费"/>
</view>
</view>
<view style="display: flex;align-items: center">
<view class="infoItem" style="flex: 1">
<text class="label">定损费</text>
<input type="text" style="text-align: left" v-model="formData.confirmFaultMoney" placeholder="请填写定损费"/>
</view>
<view class="infoItem" style="flex: 1">
<text class="label">维修类型</text>
<picker @change="repairTypeChange" :value="repairTypeIndex" :range="repairTypes" range-key="label" v-if="repairTypes">
<view class="uni-input">{{ repairTypes[repairTypeIndex].label}}</view>
</picker>
</view>
</view>
<view style="display: flex;align-items: center">
<view class="infoItem" style="flex: 1">
<text class="label">旧件处置方式</text>
<picker @change="partDisposalChange" :value="partDisposalIndex" :range="partDisposals" range-key="label" v-if="partDisposals">
<view class="uni-input">{{ partDisposals[partDisposalIndex].label}}</view>
</picker>
</view>
</view>
</view>
</template>
</view>
<view :class="{ 'none': !selectedProj || selectedProj.length === 0 }" class="card cardInfo projCard"> <view :class="{ 'none': !selectedProj || selectedProj.length === 0 }" class="card cardInfo projCard">
<template v-if="!selectedProj || selectedProj.length === 0"> <template v-if="!selectedProj || selectedProj.length === 0">
<image class="cardNoneIcon" mode="widthFix" src="/pages-order/static/projectNone.png"></image> <image class="cardNoneIcon" mode="widthFix" src="/pages-order/static/projectNone.png"></image>
@ -188,6 +278,7 @@ import {getToken, setUserInfo, getUserInfo} from '@/utils/auth.js'
import config from "@/config"; import config from "@/config";
import {formatTimestamp, formatTimestampCustom} from "@/utils/utils"; import {formatTimestamp, formatTimestampCustom} from "@/utils/utils";
import upload from "@/utils/upload"; import upload from "@/utils/upload";
import {getDictByCode,formatDate} from "@/utils/utils";
export default { export default {
components: { components: {
@ -199,6 +290,7 @@ export default {
// //
fileList: [], fileList: [],
sizeType:['compressed'], sizeType:['compressed'],
repairTypeShow:true,
phone: '', phone: '',
carList: [], carList: [],
activeCarIndex: 0, activeCarIndex: 0,
@ -206,6 +298,23 @@ export default {
selectedProj: [], selectedProj: [],
typeList: [], typeList: [],
ticketType: '01', ticketType: '01',
repairTypes:[],
repairTypeIndex:0,
partDisposals:[],
partDisposalIndex:0,
formData:{
inTime: null,
outTime: null,
mileageTraveled:null,
threePackUnits:null,
insuranceName:null,
managerMoney:0.00,
rescueMoney:0.00,
threePackMoney:0.00,
confirmFaultMoney:0.00,
partDisposal:null,
repairType:null,
},
options: [ options: [
{label: 'A单', value: '01'}, {label: 'A单', value: '01'},
{label: 'B单', value: '02'} {label: 'B单', value: '02'}
@ -215,11 +324,14 @@ export default {
} }
}, },
onLoad(data) { onLoad(data) {
this.formData.inTime = formatDate(Date.now())
this.formData.outTime = formatDate(Date.now())
this.ticketNo = this.createUniqueCodeByHead('GD') this.ticketNo = this.createUniqueCodeByHead('GD')
if (data.phone) { if (data.phone) {
this.phone = data.phone this.phone = data.phone
this.listUserInfo() this.listUserInfo()
} }
this.initDict()
setTimeout(() => { setTimeout(() => {
if (data.carId) { if (data.carId) {
for (let i = 0; i < this.carList.length; i++) { for (let i = 0; i < this.carList.length; i++) {
@ -240,6 +352,33 @@ export default {
}, },
methods: { methods: {
//
bindDateChange1(e) {
this.formData.inTime = e.target.value; // datadate
},
//
bindDateChange2(e) {
this.formData.outTime = e.target.value; // datadate
},
repairTypeChange(event){
const newIndex = event.detail.value;
this.repairTypeIndex = newIndex;
this.formData.repairType = this.repairTypes[newIndex].value;
},
partDisposalChange(event){
const newIndex = event.detail.value;
this.partDisposalIndex = newIndex;
this.formData.partDisposal = this.repairTypes[newIndex].value;
},
initDict(){
this.repairTypes = getDictByCode('repair_type')
this.partDisposals = getDictByCode('repair_part_disposal')
},
afterRead(file) { afterRead(file) {
for (let i = 0; i < file.tempFilePaths.length; i++) { for (let i = 0; i < file.tempFilePaths.length; i++) {
upload({ upload({
@ -302,7 +441,8 @@ export default {
adviserName: getUserInfo().nickname, adviserName: getUserInfo().nickname,
ticketType: this.ticketType, ticketType: this.ticketType,
itemList: this.formatItem(this.selectedProj), itemList: this.formatItem(this.selectedProj),
fileStr:fileStr fileStr:fileStr,
...this.formData,
} }
uni.navigateTo({ uni.navigateTo({
// url: '/pages-repair/signature/signature?data=' + JSON.stringify(data) // url: '/pages-repair/signature/signature?data=' + JSON.stringify(data)