|
|
|
@ -155,7 +155,7 @@ const form2 = ref({
|
|
|
|
|
})
|
|
|
|
|
const rules = {
|
|
|
|
|
outerTireNumber: [
|
|
|
|
|
{required: true, message: '请输入轮胎编号',trigger: 'change'},
|
|
|
|
|
{required: true, message: '请输入轮胎编号', trigger: 'change'},
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
const outerTireNumberOption = ref([
|
|
|
|
@ -202,6 +202,7 @@ const tyreClick = (e, location) => {
|
|
|
|
|
nowClick.value = e
|
|
|
|
|
let data = tireList.value.filter(res => res.tyrePositionVal === e)?.[0] || {}
|
|
|
|
|
form2.value = {...data, location}
|
|
|
|
|
console.log(data)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getList = async () => {
|
|
|
|
@ -268,20 +269,31 @@ const outerTireNumberSearchClick = async () => {
|
|
|
|
|
const {data} = await getTyreInfo({outerTireNumber: form2.value.outerTireNumber})
|
|
|
|
|
let list = nowClick.value?.split('-').map(e => parseFloat(e))
|
|
|
|
|
let num = 0
|
|
|
|
|
for (let i = 0; i < list?.[0] - 1; i++) {
|
|
|
|
|
num += (tireArrangement.value[i] * 4)
|
|
|
|
|
}
|
|
|
|
|
if (list[1] === 1 && list[2] === 1) {
|
|
|
|
|
num += 4
|
|
|
|
|
}
|
|
|
|
|
if (list[1] === 1 && list[2] === 2) {
|
|
|
|
|
num += 3
|
|
|
|
|
}
|
|
|
|
|
if (list[1] === 2 && list[2] === 2) {
|
|
|
|
|
if (list[0] === 1) {
|
|
|
|
|
if (list[1] === 1 && list[2] === 1) {
|
|
|
|
|
num += 2
|
|
|
|
|
}
|
|
|
|
|
if (list[1] === 2 && list[2] === 1) {
|
|
|
|
|
num += 1
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
num += 2
|
|
|
|
|
}
|
|
|
|
|
if (list[1] === 2 && list[2] === 1) {
|
|
|
|
|
num += 1
|
|
|
|
|
for (let i = 1; i < list?.[0] - 1; i++) {
|
|
|
|
|
num += (tireArrangement.value[i - 1] * 4)
|
|
|
|
|
}
|
|
|
|
|
if (list[1] === 1 && list[2] === 1) {
|
|
|
|
|
num += 4
|
|
|
|
|
}
|
|
|
|
|
if (list[1] === 1 && list[2] === 2) {
|
|
|
|
|
num += 3
|
|
|
|
|
}
|
|
|
|
|
if (list[1] === 2 && list[2] === 2) {
|
|
|
|
|
num += 2
|
|
|
|
|
}
|
|
|
|
|
if (list[1] === 2 && list[2] === 1) {
|
|
|
|
|
num += 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
form2.value.brand = data.brand
|
|
|
|
|
form2.value.size = data.size
|
|
|
|
@ -298,6 +310,7 @@ const installClick = (e) => {
|
|
|
|
|
|
|
|
|
|
proxy.$refs["form22"].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
console.log(form2.value)
|
|
|
|
|
TyreInstall({
|
|
|
|
|
...form2.value,
|
|
|
|
|
carLicense: licenseNumberOption.value.filter(e => e.value === form.value.licenseNumber)?.[0].label,
|
|
|
|
|