|
|
|
@ -63,11 +63,28 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="!!nowClick"
|
|
|
|
|
style="display: inline-block;width: calc(100% - 600px);margin-left: 40px;max-width:400px;height: 200px;vertical-align:top;">
|
|
|
|
|
<el-form :model="form2" inline label-width="120px">
|
|
|
|
|
<el-form ref="form22" :model="form2" :rules="rules" inline label-width="120px">
|
|
|
|
|
<el-form-item label="当前轮胎位置" style="width: 100%;">
|
|
|
|
|
{{ form2.location }}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="轮胎编号" style="width: 100%;">
|
|
|
|
|
<el-form-item label="轮胎编号" prop="outerTireNumber" style="width: 100%;">
|
|
|
|
|
<!-- <el-select-->
|
|
|
|
|
<!-- v-model="value"-->
|
|
|
|
|
<!-- :loading="loading"-->
|
|
|
|
|
<!-- :remote-method="outerTireNumberSearchClick"-->
|
|
|
|
|
<!-- filterable-->
|
|
|
|
|
<!-- multiple-->
|
|
|
|
|
<!-- placeholder="Please enter a keyword"-->
|
|
|
|
|
<!-- remote-->
|
|
|
|
|
<!-- reserve-keyword-->
|
|
|
|
|
<!-- >-->
|
|
|
|
|
<!-- <el-option-->
|
|
|
|
|
<!-- v-for="item in outerTireNumberOption"-->
|
|
|
|
|
<!-- :key="item.value"-->
|
|
|
|
|
<!-- :label="item.label"-->
|
|
|
|
|
<!-- :value="item.value"-->
|
|
|
|
|
<!-- />-->
|
|
|
|
|
<!-- </el-select>-->
|
|
|
|
|
<el-input v-model="form2.outerTireNumber">
|
|
|
|
|
<template #append>
|
|
|
|
|
<el-button :icon="Search" @click="outerTireNumberSearchClick"/>
|
|
|
|
@ -86,12 +103,13 @@
|
|
|
|
|
<el-form-item label="当前花纹深度" style="width: 100%;">
|
|
|
|
|
<el-input-number v-model="form2.currentTextureDepth" :precision="2" :step="0.1"/>
|
|
|
|
|
|
|
|
|
|
<el-button @click="modifiedPatternDepth">修改花纹深度</el-button>
|
|
|
|
|
<el-button @click="installClick(4)">修改花纹深度</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label=" ">
|
|
|
|
|
<el-button type="primary" @click="installClick(1)">安装</el-button>
|
|
|
|
|
<el-button type="primary" @click="installClick(2)">更换</el-button>
|
|
|
|
|
<el-button @click="uninstallClick">卸载轮胎</el-button>
|
|
|
|
|
<el-button type="primary" @click="installClick()">安装/更换</el-button>
|
|
|
|
|
<!-- <el-button type="primary" @click="installClick(1)">安装/更换</el-button>-->
|
|
|
|
|
<!-- <el-button type="primary" @click="installClick(2)">更换</el-button>-->
|
|
|
|
|
<el-button :disabled="!form2?.tyreId" @click="uninstallClick(3)">卸载轮胎</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
|
|
|
@ -99,7 +117,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script name="basetyre" setup>
|
|
|
|
|
import {listCarQueue, setCarTyres} from "@/api/tireManagement/install";
|
|
|
|
|
import {listCarQueue, setCarTyres, TyreInstall, getTyreInfo, TyreUnInstall} from "@/api/tireManagement/install";
|
|
|
|
|
import {Search} from '@element-plus/icons-vue'
|
|
|
|
|
import {useI18n} from 'vue-i18n';
|
|
|
|
|
import Cookies from "js-cookie";
|
|
|
|
@ -132,9 +150,36 @@ const form2 = ref({
|
|
|
|
|
outerTireNumber: null,
|
|
|
|
|
sensorId: "",
|
|
|
|
|
size: "",
|
|
|
|
|
tyrePositionVal: '',
|
|
|
|
|
tyrePosition: "",
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const rules = {
|
|
|
|
|
outerTireNumber: [
|
|
|
|
|
{required: true, message: '请输入轮胎编号',trigger: 'change'},
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
const outerTireNumberOption = ref([
|
|
|
|
|
{
|
|
|
|
|
value: 'Option1',
|
|
|
|
|
label: 'Option1',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'Option2',
|
|
|
|
|
label: 'Option2',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'Option3',
|
|
|
|
|
label: 'Option3',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'Option4',
|
|
|
|
|
label: 'Option4',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'Option5',
|
|
|
|
|
label: 'Option5',
|
|
|
|
|
}
|
|
|
|
|
])
|
|
|
|
|
const backgroundColorState = (e) => {
|
|
|
|
|
if (installedTyre.value.includes(e)) {
|
|
|
|
|
return '#41ca7f'
|
|
|
|
@ -155,9 +200,8 @@ const borderColorState = (e) => {
|
|
|
|
|
|
|
|
|
|
const tyreClick = (e, location) => {
|
|
|
|
|
nowClick.value = e
|
|
|
|
|
let data = tireList.value.filter(res => res.tyrePosition === e)?.[0] || {}
|
|
|
|
|
let data = tireList.value.filter(res => res.tyrePositionVal === e)?.[0] || {}
|
|
|
|
|
form2.value = {...data, location}
|
|
|
|
|
console.log(form2.value)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getList = async () => {
|
|
|
|
@ -181,8 +225,9 @@ const carQueueChange = (e) => {
|
|
|
|
|
outerTireNumber: null,
|
|
|
|
|
sensorId: "",
|
|
|
|
|
size: "",
|
|
|
|
|
tyrePositionVal: '',
|
|
|
|
|
tyrePosition: "",
|
|
|
|
|
tyreiId:''
|
|
|
|
|
tyreiId: ''
|
|
|
|
|
}
|
|
|
|
|
let option = carQueueList.value.filter(res => res.id === e)[0]?.baseCarList || []
|
|
|
|
|
option.length !== 0 ? isLicenseNumber.value = false : isLicenseNumber.value = true
|
|
|
|
@ -201,51 +246,89 @@ const licenseNumberChange = async (e) => {
|
|
|
|
|
outerTireNumber: null,
|
|
|
|
|
sensorId: "",
|
|
|
|
|
size: "",
|
|
|
|
|
tyrePositionVal: "",
|
|
|
|
|
tyrePosition: "",
|
|
|
|
|
tyreiId:''
|
|
|
|
|
tyreiId: ''
|
|
|
|
|
}
|
|
|
|
|
nowClick.value = ''
|
|
|
|
|
const {data: res} = await setCarTyres({id: form.value.licenseNumber})
|
|
|
|
|
tireArrangement.value = (res.carType?.split('T')[1]?.split('|').filter(e => e !== '') || []).map((res) => {
|
|
|
|
|
return parseInt(res.split('-')[1])
|
|
|
|
|
})
|
|
|
|
|
installedTyre.value = res.carTyresList.map(e => (e.tyrePosition.split('-')[0] + '-' + e.tyrePosition.split('-')[1] + '-' + e.tyrePosition.split('-')[2]))
|
|
|
|
|
installedTyre.value = res.carTyresList.map(e => (e.tyrePosition?.split('-')[0] + '-' + e.tyrePosition?.split('-')[1] + '-' + e.tyrePosition?.split('-')[2]))
|
|
|
|
|
tireList.value = res.carTyresList.map(e => {
|
|
|
|
|
return {
|
|
|
|
|
...e,
|
|
|
|
|
tyrePosition: e.tyrePosition.split('-')[0] + '-' + e.tyrePosition.split('-')[1] + '-' + e.tyrePosition.split('-')[2]
|
|
|
|
|
tyrePositionVal: e.tyrePosition?.split('-')[0] + '-' + e.tyrePosition?.split('-')[1] + '-' + e.tyrePosition?.split('-')[2]
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const outerTireNumberSearchClick = () => {
|
|
|
|
|
console.log(form2.value.outerTireNumber)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const modifiedPatternDepth =() =>{
|
|
|
|
|
console.log({
|
|
|
|
|
currentTextureDepth:form2.value.currentTextureDepth,
|
|
|
|
|
tyreiId:form2.value.tyreiId,
|
|
|
|
|
carLicense:licenseNumberOption.value.filter(e => e.value === form.value.licenseNumber)?.[0].label,
|
|
|
|
|
id:form.value.licenseNumber
|
|
|
|
|
})
|
|
|
|
|
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) {
|
|
|
|
|
num += 2
|
|
|
|
|
}
|
|
|
|
|
if (list[1] === 2 && list[2] === 1) {
|
|
|
|
|
num += 1
|
|
|
|
|
}
|
|
|
|
|
form2.value.brand = data.brand
|
|
|
|
|
form2.value.size = data.size
|
|
|
|
|
form2.value.sensorId = data.sensorId
|
|
|
|
|
form2.value.tyreId = data.id
|
|
|
|
|
form2.value.tyrePosition = nowClick.value + '-' + num
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const installClick = (e) => {
|
|
|
|
|
console.log(e === 1? '安装' :'更换')
|
|
|
|
|
console.log({
|
|
|
|
|
...form2.value,
|
|
|
|
|
carLicense:licenseNumberOption.value.filter(e => e.value === form.value.licenseNumber)?.[0].label,
|
|
|
|
|
id:form.value.licenseNumber
|
|
|
|
|
})
|
|
|
|
|
let state = e
|
|
|
|
|
if (!e) {
|
|
|
|
|
state = 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
proxy.$refs["form22"].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
TyreInstall({
|
|
|
|
|
...form2.value,
|
|
|
|
|
carLicense: licenseNumberOption.value.filter(e => e.value === form.value.licenseNumber)?.[0].label,
|
|
|
|
|
carId: form.value.licenseNumber,
|
|
|
|
|
type: state
|
|
|
|
|
}).then(async (e) => {
|
|
|
|
|
proxy.$modal.msgSuccess(e.msg);
|
|
|
|
|
let param = nowClick.value
|
|
|
|
|
let str = form2.value.location
|
|
|
|
|
await licenseNumberChange()
|
|
|
|
|
tyreClick(param, str)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const uninstallClick = () => {
|
|
|
|
|
console.log({
|
|
|
|
|
tyreiId:form2.value.tyreiId,
|
|
|
|
|
carLicense:licenseNumberOption.value.filter(e => e.value === form.value.licenseNumber)?.[0].label,
|
|
|
|
|
id:form.value.licenseNumber
|
|
|
|
|
})
|
|
|
|
|
const uninstallClick = (val) => {
|
|
|
|
|
if (form2.value.tyreId) {
|
|
|
|
|
TyreUnInstall({
|
|
|
|
|
...form2.value,
|
|
|
|
|
carLicense: licenseNumberOption.value.filter(e => e.value === form.value.licenseNumber)?.[0].label,
|
|
|
|
|
carId: form.value.licenseNumber,
|
|
|
|
|
type: val
|
|
|
|
|
}).then(async (e) => {
|
|
|
|
|
proxy.$modal.msgSuccess(e.msg);
|
|
|
|
|
let param = nowClick.value
|
|
|
|
|
let str = form2.value.location
|
|
|
|
|
await licenseNumberChange()
|
|
|
|
|
tyreClick(param, str)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getList()
|
|
|
|
|