更新新建工单相关功能
This commit is contained in:
parent
50f9b53506
commit
1105699364
@ -12,7 +12,7 @@
|
|||||||
<view class="searchBox">
|
<view class="searchBox">
|
||||||
<input v-model="phone" placeholder="请输入手机号码" type="tel">
|
<input v-model="phone" placeholder="请输入手机号码" type="tel">
|
||||||
</view>
|
</view>
|
||||||
<view class="btn">
|
<view class="btn" @click="listUserInfo">
|
||||||
<image class="btnIcon" mode="aspectFit" src="/pages-order/static/search.png"></image>
|
<image class="btnIcon" mode="aspectFit" src="/pages-order/static/search.png"></image>
|
||||||
确认查找
|
确认查找
|
||||||
</view>
|
</view>
|
||||||
@ -32,42 +32,42 @@
|
|||||||
<view class="carListTab">
|
<view class="carListTab">
|
||||||
<view v-for="(item, index) in carList" :key="index" :class="{'active': activeCarIndex === index}"
|
<view v-for="(item, index) in carList" :key="index" :class="{'active': activeCarIndex === index}"
|
||||||
class="carTabItem" @click="() => 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>
|
<text>{{ item.licenseNumber }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="carDetail">
|
<view class="carDetail">
|
||||||
<view class="carHeader">
|
<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">
|
<view class="carHeaderRight">
|
||||||
<text class="carNumber">{{ carList[activeCarIndex].licenseNumber }}</text>
|
<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>
|
</view>
|
||||||
<view class="carBody">
|
<view class="carBody">
|
||||||
<view style="display: flex;align-items: center">
|
<view style="display: flex;align-items: center">
|
||||||
<view class="infoItem" style="flex: 1">
|
<view class="infoItem" style="flex: 1">
|
||||||
<view class="label">车架号</view>
|
<view class="label">车架号</view>
|
||||||
<view class="value">{{ carList[activeCarIndex].cjNo }}</view>
|
<view class="value">{{ carList[activeCarIndex].vin }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="infoItem" style="flex: 1">
|
<view class="infoItem" style="flex: 1">
|
||||||
<view class="label">发动机号</view>
|
<view class="label">发动机号</view>
|
||||||
<view class="value">{{ carList[activeCarIndex].fdjNo }}</view>
|
<view class="value">{{ carList[activeCarIndex].engineNumber }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="display: flex;align-items: center">
|
<view style="display: flex;align-items: center">
|
||||||
<view class="infoItem" style="flex: 1">
|
<view class="infoItem" style="flex: 1">
|
||||||
<view class="label">年检时间</view>
|
<view class="label">年检时间</view>
|
||||||
<view class="value">{{ carList[activeCarIndex].njDate }}</view>
|
<view class="value">{{ carList[activeCarIndex].nextInspectionDate }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="infoItem" style="flex: 1">
|
<view class="infoItem" style="flex: 1">
|
||||||
<view class="label">保险时间</view>
|
<view class="label">保险时间</view>
|
||||||
<view class="value">{{ carList[activeCarIndex].bxDate }}</view>
|
<view class="value">{{ carList[activeCarIndex].insuranceExpiryDate }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="infoItem">
|
<view class="infoItem">
|
||||||
<view class="label">注册日期</view>
|
<view class="label">注册日期</view>
|
||||||
<view class="value">{{ carList[activeCarIndex].zcrqDate }}</view>
|
<view class="value">{{ carList[activeCarIndex].carRegisterDate }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="carFoot">
|
<view class="carFoot">
|
||||||
@ -92,7 +92,7 @@
|
|||||||
<view style="display: flex;align-items: center">
|
<view style="display: flex;align-items: center">
|
||||||
<view class="infoItem" style="flex: 1">
|
<view class="infoItem" style="flex: 1">
|
||||||
<text class="label">姓名</text>
|
<text class="label">姓名</text>
|
||||||
<text class="value">{{ userInfo.name }}</text>
|
<text class="value">{{ userInfo.cusName }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="infoItem" style="flex: 1">
|
<view class="infoItem" style="flex: 1">
|
||||||
<text class="label">性别</text>
|
<text class="label">性别</text>
|
||||||
@ -102,7 +102,7 @@
|
|||||||
<view style="display: flex;align-items: center">
|
<view style="display: flex;align-items: center">
|
||||||
<view class="infoItem" style="flex: 1">
|
<view class="infoItem" style="flex: 1">
|
||||||
<text class="label">联系方式</text>
|
<text class="label">联系方式</text>
|
||||||
<text class="value">{{ userInfo.phone }}</text>
|
<text class="value">{{ userInfo.phoneNumber }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="infoItem" style="flex: 1">
|
<view class="infoItem" style="flex: 1">
|
||||||
<text class="label">出生年月</text>
|
<text class="label">出生年月</text>
|
||||||
@ -158,6 +158,7 @@
|
|||||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||||
import ProjectPicker from "@/components/projectPicker.vue";
|
import ProjectPicker from "@/components/projectPicker.vue";
|
||||||
import {bus} from "@/utils/eventBus";
|
import {bus} from "@/utils/eventBus";
|
||||||
|
import request from "@/utils/request";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -167,38 +168,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
phone: '',
|
phone: '',
|
||||||
carList: [
|
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: ''
|
|
||||||
}
|
|
||||||
],
|
|
||||||
activeCarIndex: 0,
|
activeCarIndex: 0,
|
||||||
userInfo: null,
|
userInfo: null,
|
||||||
selectedProj: []
|
selectedProj: []
|
||||||
@ -216,6 +186,38 @@ export default {
|
|||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
}, 600)
|
}, 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) {
|
editCarInfo(index) {
|
||||||
bus.$off('updateCarInfo')
|
bus.$off('updateCarInfo')
|
||||||
bus.$on('updateCarInfo', (carInfo) => {
|
bus.$on('updateCarInfo', (carInfo) => {
|
||||||
|
@ -20,9 +20,22 @@
|
|||||||
name="arrow-right"
|
name="arrow-right"
|
||||||
></u-icon>
|
></u-icon>
|
||||||
</u-form-item>
|
</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-form-item label="车辆型号" labelWidth="200" @click="showType = true; hideKeyboard()">
|
||||||
<u-input
|
<u-input
|
||||||
v-model="car.carCategory"
|
v-model="car.modelStr"
|
||||||
border="none"
|
border="none"
|
||||||
disabled
|
disabled
|
||||||
disabledColor="#ffffff"
|
disabledColor="#ffffff"
|
||||||
@ -37,14 +50,14 @@
|
|||||||
|
|
||||||
<view class="card">
|
<view class="card">
|
||||||
<u-form-item borderBottom label="车架号" labelWidth="200">
|
<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>
|
||||||
<u-form-item borderBottom label="发动机号" labelWidth="200">
|
<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>
|
||||||
<u-form-item borderBottom label="年检时间" labelWidth="200" @click="openDatePicker('nj'); hideKeyboard()">
|
<u-form-item borderBottom label="年检时间" labelWidth="200" @click="openDatePicker('nj'); hideKeyboard()">
|
||||||
<u-input
|
<u-input
|
||||||
v-model="car.njDate"
|
v-model="car.inspectionDate"
|
||||||
border="none"
|
border="none"
|
||||||
disabled
|
disabled
|
||||||
disabledColor="#ffffff"
|
disabledColor="#ffffff"
|
||||||
@ -57,7 +70,7 @@
|
|||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item borderBottom label="保险时间" labelWidth="200" @click="openDatePicker('bx'); hideKeyboard()">
|
<u-form-item borderBottom label="保险时间" labelWidth="200" @click="openDatePicker('bx'); hideKeyboard()">
|
||||||
<u-input
|
<u-input
|
||||||
v-model="car.bxDate"
|
v-model="car.insuranceDate"
|
||||||
border="none"
|
border="none"
|
||||||
disabled
|
disabled
|
||||||
disabledColor="#ffffff"
|
disabledColor="#ffffff"
|
||||||
@ -70,7 +83,7 @@
|
|||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="注册日期时间" labelWidth="200" @click="openDatePicker('zcrq'); hideKeyboard()">
|
<u-form-item label="注册日期时间" labelWidth="200" @click="openDatePicker('zcrq'); hideKeyboard()">
|
||||||
<u-input
|
<u-input
|
||||||
v-model="car.zcrqDate"
|
v-model="car.carRegisterDate"
|
||||||
border="none"
|
border="none"
|
||||||
disabled
|
disabled
|
||||||
disabledColor="#ffffff"
|
disabledColor="#ffffff"
|
||||||
@ -84,6 +97,15 @@
|
|||||||
</view>
|
</view>
|
||||||
</u-form>
|
</u-form>
|
||||||
|
|
||||||
|
<!-- 车辆品牌 -->
|
||||||
|
<u-action-sheet
|
||||||
|
:actions="brandList"
|
||||||
|
:show="brandType"
|
||||||
|
title="请选择车辆品牌"
|
||||||
|
@close="brandType = false"
|
||||||
|
@select="brandSelect"
|
||||||
|
>
|
||||||
|
</u-action-sheet>
|
||||||
<!-- 车辆型号 -->
|
<!-- 车辆型号 -->
|
||||||
<u-action-sheet
|
<u-action-sheet
|
||||||
:actions="typeList"
|
:actions="typeList"
|
||||||
@ -116,6 +138,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import VNavigationBar from '@/components/VNavigationBar.vue';
|
import VNavigationBar from '@/components/VNavigationBar.vue';
|
||||||
import {bus} from "@/utils/eventBus";
|
import {bus} from "@/utils/eventBus";
|
||||||
|
import request from "@/utils/request";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -137,6 +160,8 @@ export default {
|
|||||||
carNature: '',
|
carNature: '',
|
||||||
// 注册日期
|
// 注册日期
|
||||||
carRegisterDate: '2024-09-24',
|
carRegisterDate: '2024-09-24',
|
||||||
|
// 车辆品牌型号数组
|
||||||
|
brandAndModel: '',
|
||||||
},
|
},
|
||||||
bo1: false,
|
bo1: false,
|
||||||
bo2: true,
|
bo2: true,
|
||||||
@ -144,14 +169,12 @@ export default {
|
|||||||
datePickerShow: false,
|
datePickerShow: false,
|
||||||
datePickerValue: new Date().getTime(),
|
datePickerValue: new Date().getTime(),
|
||||||
pickerConfirmField: 'njDate',
|
pickerConfirmField: 'njDate',
|
||||||
|
brandId:'',
|
||||||
|
|
||||||
showType: false,
|
showType: false,
|
||||||
typeList: [
|
brandType: false,
|
||||||
{
|
typeList: [],
|
||||||
name: '一汽奥迪 2024款 A6L',
|
brandList: [],
|
||||||
value: '1'
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
@ -169,11 +192,52 @@ export default {
|
|||||||
this.bo2 = true;
|
this.bo2 = true;
|
||||||
this.pageTitle = '添加车辆信息'
|
this.pageTitle = '添加车辆信息'
|
||||||
}
|
}
|
||||||
|
this.getBrandList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
typeSelect(e) {
|
typeSelect(e) {
|
||||||
console.log('e', 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() {
|
carInputClick() {
|
||||||
@ -219,6 +283,19 @@ export default {
|
|||||||
async submit() {
|
async submit() {
|
||||||
|
|
||||||
bus.$emit('updateCarInfo', this.car)
|
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();
|
uni.navigateBack();
|
||||||
// let res = await request({
|
// let res = await request({
|
||||||
// url: '/userClient/base/myCar/create',
|
// url: '/userClient/base/myCar/create',
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<u-form labelPosition="top">
|
<u-form labelPosition="top">
|
||||||
<view class="card">
|
<view class="card">
|
||||||
<u-form-item borderBottom label="姓名" label-width="200">
|
<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>
|
||||||
<u-form-item borderBottom label="性别" label-width="200">
|
<u-form-item borderBottom label="性别" label-width="200">
|
||||||
<u-radio-group
|
<u-radio-group
|
||||||
@ -17,7 +17,7 @@
|
|||||||
</u-radio-group>
|
</u-radio-group>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item borderBottom label="联系方式" label-width="200">
|
<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>
|
||||||
<u-form-item borderBottom label="出生年月" labelWidth="200" @click="openDatePicker(); hideKeyboard()">
|
<u-form-item borderBottom label="出生年月" labelWidth="200" @click="openDatePicker(); hideKeyboard()">
|
||||||
<u-input
|
<u-input
|
||||||
@ -72,7 +72,7 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="footer">
|
<view class="footer">
|
||||||
<view v-if="bo2" class="btnItem edit" @click="submit">
|
<view class="btnItem edit" @click="submit">
|
||||||
确定
|
确定
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -85,6 +85,7 @@
|
|||||||
import VNavigationBar from '@/components/VNavigationBar.vue';
|
import VNavigationBar from '@/components/VNavigationBar.vue';
|
||||||
import cityPicker from '@/uni_modules/piaoyi-cityPicker/components/piaoyi-cityPicker/piaoyi-cityPicker'
|
import cityPicker from '@/uni_modules/piaoyi-cityPicker/components/piaoyi-cityPicker/piaoyi-cityPicker'
|
||||||
import {bus} from "@/utils/eventBus";
|
import {bus} from "@/utils/eventBus";
|
||||||
|
import request from "@/utils/request";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -180,6 +181,22 @@ export default {
|
|||||||
async submit() {
|
async submit() {
|
||||||
|
|
||||||
bus.$emit('updateUserInfo', this.userInfo)
|
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()
|
uni.navigateBack()
|
||||||
// let res = await request({
|
// let res = await request({
|
||||||
// url: '/userClient/base/myCar/create',
|
// url: '/userClient/base/myCar/create',
|
||||||
|
Loading…
Reference in New Issue
Block a user