更新新建工单相关功能

This commit is contained in:
许允枞 2024-10-17 21:34:02 +08:00
parent 50f9b53506
commit 1105699364
3 changed files with 154 additions and 58 deletions

View File

@ -12,7 +12,7 @@
<view class="searchBox">
<input v-model="phone" placeholder="请输入手机号码" type="tel">
</view>
<view class="btn">
<view class="btn" @click="listUserInfo">
<image class="btnIcon" mode="aspectFit" src="/pages-order/static/search.png"></image>
确认查找
</view>
@ -32,42 +32,42 @@
<view class="carListTab">
<view v-for="(item, index) in carList" :key="index" :class="{'active': activeCarIndex === index}"
class="carTabItem" @click="() => activeCarIndex = index">
<image :src="item.image" class="carImage" mode="aspectFit"></image>
<image :src="item.carLicenseImg" class="carImage" mode="aspectFit"></image>
<text>{{ item.licenseNumber }}</text>
</view>
</view>
<view class="carDetail">
<view class="carHeader">
<image :src="carList[activeCarIndex].image" class="carImage" mode="aspectFill"></image>
<image :src="carList[activeCarIndex].carLicenseImg" class="carImage" mode="aspectFill"></image>
<view class="carHeaderRight">
<text class="carNumber">{{ carList[activeCarIndex].licenseNumber }}</text>
<text class="carType">{{ carList[activeCarIndex].carCategory }}</text>
<text class="carType">{{ (carList[activeCarIndex].brandStr == null ? '' : carList[activeCarIndex].brandStr) + ' ' + (carList[activeCarIndex].modelStr == null ? '' : carList[activeCarIndex].modelStr) }}</text>
</view>
</view>
<view class="carBody">
<view style="display: flex;align-items: center">
<view class="infoItem" style="flex: 1">
<view class="label">车架号</view>
<view class="value">{{ carList[activeCarIndex].cjNo }}</view>
<view class="value">{{ carList[activeCarIndex].vin }}</view>
</view>
<view class="infoItem" style="flex: 1">
<view class="label">发动机号</view>
<view class="value">{{ carList[activeCarIndex].fdjNo }}</view>
<view class="value">{{ carList[activeCarIndex].engineNumber }}</view>
</view>
</view>
<view style="display: flex;align-items: center">
<view class="infoItem" style="flex: 1">
<view class="label">年检时间</view>
<view class="value">{{ carList[activeCarIndex].njDate }}</view>
<view class="value">{{ carList[activeCarIndex].nextInspectionDate }}</view>
</view>
<view class="infoItem" style="flex: 1">
<view class="label">保险时间</view>
<view class="value">{{ carList[activeCarIndex].bxDate }}</view>
<view class="value">{{ carList[activeCarIndex].insuranceExpiryDate }}</view>
</view>
</view>
<view class="infoItem">
<view class="label">注册日期</view>
<view class="value">{{ carList[activeCarIndex].zcrqDate }}</view>
<view class="value">{{ carList[activeCarIndex].carRegisterDate }}</view>
</view>
</view>
<view class="carFoot">
@ -92,7 +92,7 @@
<view style="display: flex;align-items: center">
<view class="infoItem" style="flex: 1">
<text class="label">姓名</text>
<text class="value">{{ userInfo.name }}</text>
<text class="value">{{ userInfo.cusName }}</text>
</view>
<view class="infoItem" style="flex: 1">
<text class="label">性别</text>
@ -102,7 +102,7 @@
<view style="display: flex;align-items: center">
<view class="infoItem" style="flex: 1">
<text class="label">联系方式</text>
<text class="value">{{ userInfo.phone }}</text>
<text class="value">{{ userInfo.phoneNumber }}</text>
</view>
<view class="infoItem" style="flex: 1">
<text class="label">出生年月</text>
@ -158,6 +158,7 @@
import VNavigationBar from '@/components/VNavigationBar.vue'
import ProjectPicker from "@/components/projectPicker.vue";
import {bus} from "@/utils/eventBus";
import request from "@/utils/request";
export default {
components: {
@ -167,38 +168,7 @@ export default {
data() {
return {
phone: '',
carList: [
{
licenseNumber: '川A 184AO1',
carCategory: '一汽奥迪 2024款 A6L',
cjNo: '124105112425',
fdjNo: '124109581905',
njDate: '2024年',
bxDate: '2024年',
zcrqDate: '2023-10-20',
image: ''
},
{
licenseNumber: '川A 34225A',
carCategory: '一汽奥迪 2024款 A6L',
cjNo: '124105112425',
fdjNo: '124109581905',
njDate: '2024年',
bxDate: '2024年',
zcrqDate: '2023-10-20',
image: ''
},
{
licenseNumber: '川A 34225A',
carCategory: '一汽奥迪 2024款 A6L',
cjNo: '124105112425',
fdjNo: '124109581905',
njDate: '2024年',
bxDate: '2024年',
zcrqDate: '2023-10-20',
image: ''
}
],
carList: [],
activeCarIndex: 0,
userInfo: null,
selectedProj: []
@ -216,6 +186,38 @@ export default {
uni.navigateBack();
}, 600)
},
listUserInfo() {
this.carList = []
this.userInfo = null
console.log("获取用户信息")
const params = {
phoneNumber: this.phone
}
request({
url: '/admin-api/base/custom/page',
method: 'GET',
params: params
}).then(res => {
console.log(res);
if (res.data.records.length > 0) {
this.userInfo = res.data.records[0]
this.getCarList()
}
})
},
getCarList() {
const params = {
userId: this.userInfo.userId
}
request({
url: '/admin-api/base/carMain/page',
method: 'GET',
params: params
}).then(res => {
console.log(res);
this.carList = res.data.records
})
},
editCarInfo(index) {
bus.$off('updateCarInfo')
bus.$on('updateCarInfo', (carInfo) => {

View File

@ -20,9 +20,22 @@
name="arrow-right"
></u-icon>
</u-form-item>
<u-form-item label="车辆品牌" labelWidth="200" @click="brandType = true; hideKeyboard()">
<u-input
v-model="car.brandStr"
border="none"
disabled
disabledColor="#ffffff"
placeholder="请选择车辆品牌"
></u-input>
<u-icon
slot="right"
name="arrow-right"
></u-icon>
</u-form-item>
<u-form-item label="车辆型号" labelWidth="200" @click="showType = true; hideKeyboard()">
<u-input
v-model="car.carCategory"
v-model="car.modelStr"
border="none"
disabled
disabledColor="#ffffff"
@ -37,14 +50,14 @@
<view class="card">
<u-form-item borderBottom label="车架号" labelWidth="200">
<u-input v-model="car.cjNo" border="none" placeholder="请输入车架号"></u-input>
<u-input v-model="car.vin" border="none" placeholder="请输入车架号"></u-input>
</u-form-item>
<u-form-item borderBottom label="发动机号" labelWidth="200">
<u-input v-model="car.fdjNo" border="none" placeholder="请输入发动机号"></u-input>
<u-input v-model="car.engineNumber" border="none" placeholder="请输入发动机号"></u-input>
</u-form-item>
<u-form-item borderBottom label="年检时间" labelWidth="200" @click="openDatePicker('nj'); hideKeyboard()">
<u-input
v-model="car.njDate"
v-model="car.inspectionDate"
border="none"
disabled
disabledColor="#ffffff"
@ -57,7 +70,7 @@
</u-form-item>
<u-form-item borderBottom label="保险时间" labelWidth="200" @click="openDatePicker('bx'); hideKeyboard()">
<u-input
v-model="car.bxDate"
v-model="car.insuranceDate"
border="none"
disabled
disabledColor="#ffffff"
@ -70,7 +83,7 @@
</u-form-item>
<u-form-item label="注册日期时间" labelWidth="200" @click="openDatePicker('zcrq'); hideKeyboard()">
<u-input
v-model="car.zcrqDate"
v-model="car.carRegisterDate"
border="none"
disabled
disabledColor="#ffffff"
@ -84,6 +97,15 @@
</view>
</u-form>
<!-- 车辆品牌 -->
<u-action-sheet
:actions="brandList"
:show="brandType"
title="请选择车辆品牌"
@close="brandType = false"
@select="brandSelect"
>
</u-action-sheet>
<!-- 车辆型号 -->
<u-action-sheet
:actions="typeList"
@ -116,6 +138,7 @@
<script>
import VNavigationBar from '@/components/VNavigationBar.vue';
import {bus} from "@/utils/eventBus";
import request from "@/utils/request";
export default {
components: {
@ -137,6 +160,8 @@ export default {
carNature: '',
//
carRegisterDate: '2024-09-24',
//
brandAndModel: '',
},
bo1: false,
bo2: true,
@ -144,14 +169,12 @@ export default {
datePickerShow: false,
datePickerValue: new Date().getTime(),
pickerConfirmField: 'njDate',
brandId:'',
showType: false,
typeList: [
{
name: '一汽奥迪 2024款 A6L',
value: '1'
},
],
brandType: false,
typeList: [],
brandList: [],
};
},
onLoad(options) {
@ -169,11 +192,52 @@ export default {
this.bo2 = true;
this.pageTitle = '添加车辆信息'
}
this.getBrandList()
},
methods: {
typeSelect(e) {
console.log('e', e)
},
brandSelect(e) {
console.log('e', e)
this.brandId = e.value
this.getCarModule()
},
getCarModule() {
request({
url: '/admin-api/base/carModel/pageById',
method: 'GET',
params: {
page: 1,
size: 10000,
brandId: this.brandId
}
}).then(res => {
console.log(res);
res.data.records.forEach(item => {
item.name = item.modelName,
item.value = item.id
})
this.typeList = res.data.records
})
},
getBrandList() {
request({
url: '/admin-api/base/carBrand/page',
method: 'GET',
params: {
page: 1,
size: 10000
}
}).then(res => {
console.log(res);
res.data.records.forEach(item => {
item.name = item.brandName,
item.value = item.id
})
this.brandList = res.data.records
})
},
//
carInputClick() {
@ -219,6 +283,19 @@ export default {
async submit() {
bus.$emit('updateCarInfo', this.car)
if (this.car.id != null) {
request({
url: '/admin-api/base/carMain/update',
method: 'PUT',
data: this.car,
})
} else {
request({
url: '/admin-api/base/carMain/create',
method: 'POST',
data: this.car,
})
}
uni.navigateBack();
// let res = await request({
// url: '/userClient/base/myCar/create',

View File

@ -5,7 +5,7 @@
<u-form labelPosition="top">
<view class="card">
<u-form-item borderBottom label="姓名" label-width="200">
<u-input v-model="userInfo.name" border="none" placeholder="请输入客户姓名"></u-input>
<u-input v-model="userInfo.cusName" border="none" placeholder="请输入客户姓名"></u-input>
</u-form-item>
<u-form-item borderBottom label="性别" label-width="200">
<u-radio-group
@ -17,7 +17,7 @@
</u-radio-group>
</u-form-item>
<u-form-item borderBottom label="联系方式" label-width="200">
<u-input v-model="userInfo.phone" border="none" placeholder="请输入联系方式" type="number"></u-input>
<u-input v-model="userInfo.phoneNumber" border="none" placeholder="请输入联系方式" type="number"></u-input>
</u-form-item>
<u-form-item borderBottom label="出生年月" labelWidth="200" @click="openDatePicker(); hideKeyboard()">
<u-input
@ -72,7 +72,7 @@
</view>
<view class="footer">
<view v-if="bo2" class="btnItem edit" @click="submit">
<view class="btnItem edit" @click="submit">
确定
</view>
</view>
@ -85,6 +85,7 @@
import VNavigationBar from '@/components/VNavigationBar.vue';
import cityPicker from '@/uni_modules/piaoyi-cityPicker/components/piaoyi-cityPicker/piaoyi-cityPicker'
import {bus} from "@/utils/eventBus";
import request from "@/utils/request";
export default {
components: {
@ -180,6 +181,22 @@ export default {
async submit() {
bus.$emit('updateUserInfo', this.userInfo)
if (this.userInfo.id != null) {
request({
url: '/admin-api/base/custom/update',
method: 'PUT',
data: this.userInfo,
})
}else {
console.log("执行了新增")
this.userInfo.typeCode = "01"
request({
url: '/admin-api/base/custom/create',
method: 'POST',
data: this.userInfo,
})
}
uni.navigateBack()
// let res = await request({
// url: '/userClient/base/myCar/create',