|
|
@ -63,11 +63,28 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-if="!!nowClick"
|
|
|
|
<div v-if="!!nowClick"
|
|
|
|
style="display: inline-block;width: calc(100% - 600px);margin-left: 40px;max-width:400px;height: 200px;vertical-align:top;">
|
|
|
|
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%;">
|
|
|
|
<el-form-item label="当前轮胎位置" style="width: 100%;">
|
|
|
|
{{ form2.location }}
|
|
|
|
{{ form2.location }}
|
|
|
|
</el-form-item>
|
|
|
|
</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">
|
|
|
|
<el-input v-model="form2.outerTireNumber">
|
|
|
|
<template #append>
|
|
|
|
<template #append>
|
|
|
|
<el-button :icon="Search" @click="outerTireNumberSearchClick"/>
|
|
|
|
<el-button :icon="Search" @click="outerTireNumberSearchClick"/>
|
|
|
@ -86,12 +103,13 @@
|
|
|
|
<el-form-item label="当前花纹深度" style="width: 100%;">
|
|
|
|
<el-form-item label="当前花纹深度" style="width: 100%;">
|
|
|
|
<el-input-number v-model="form2.currentTextureDepth" :precision="2" :step="0.1"/>
|
|
|
|
<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>
|
|
|
|
<el-form-item label=" ">
|
|
|
|
<el-form-item label=" ">
|
|
|
|
<el-button type="primary" @click="installClick(1)">安装</el-button>
|
|
|
|
<el-button type="primary" @click="installClick()">安装/更换</el-button>
|
|
|
|
<el-button type="primary" @click="installClick(2)">更换</el-button>
|
|
|
|
<!-- <el-button type="primary" @click="installClick(1)">安装/更换</el-button>-->
|
|
|
|
<el-button @click="uninstallClick">卸载轮胎</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-item>
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -99,7 +117,7 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script name="basetyre" setup>
|
|
|
|
<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 {Search} from '@element-plus/icons-vue'
|
|
|
|
import {useI18n} from 'vue-i18n';
|
|
|
|
import {useI18n} from 'vue-i18n';
|
|
|
|
import Cookies from "js-cookie";
|
|
|
|
import Cookies from "js-cookie";
|
|
|
@ -132,9 +150,36 @@ const form2 = ref({
|
|
|
|
outerTireNumber: null,
|
|
|
|
outerTireNumber: null,
|
|
|
|
sensorId: "",
|
|
|
|
sensorId: "",
|
|
|
|
size: "",
|
|
|
|
size: "",
|
|
|
|
|
|
|
|
tyrePositionVal: '',
|
|
|
|
tyrePosition: "",
|
|
|
|
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) => {
|
|
|
|
const backgroundColorState = (e) => {
|
|
|
|
if (installedTyre.value.includes(e)) {
|
|
|
|
if (installedTyre.value.includes(e)) {
|
|
|
|
return '#41ca7f'
|
|
|
|
return '#41ca7f'
|
|
|
@ -155,9 +200,8 @@ const borderColorState = (e) => {
|
|
|
|
|
|
|
|
|
|
|
|
const tyreClick = (e, location) => {
|
|
|
|
const tyreClick = (e, location) => {
|
|
|
|
nowClick.value = e
|
|
|
|
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}
|
|
|
|
form2.value = {...data, location}
|
|
|
|
console.log(form2.value)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const getList = async () => {
|
|
|
|
const getList = async () => {
|
|
|
@ -181,8 +225,9 @@ const carQueueChange = (e) => {
|
|
|
|
outerTireNumber: null,
|
|
|
|
outerTireNumber: null,
|
|
|
|
sensorId: "",
|
|
|
|
sensorId: "",
|
|
|
|
size: "",
|
|
|
|
size: "",
|
|
|
|
|
|
|
|
tyrePositionVal: '',
|
|
|
|
tyrePosition: "",
|
|
|
|
tyrePosition: "",
|
|
|
|
tyreiId:''
|
|
|
|
tyreiId: ''
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let option = carQueueList.value.filter(res => res.id === e)[0]?.baseCarList || []
|
|
|
|
let option = carQueueList.value.filter(res => res.id === e)[0]?.baseCarList || []
|
|
|
|
option.length !== 0 ? isLicenseNumber.value = false : isLicenseNumber.value = true
|
|
|
|
option.length !== 0 ? isLicenseNumber.value = false : isLicenseNumber.value = true
|
|
|
@ -201,51 +246,89 @@ const licenseNumberChange = async (e) => {
|
|
|
|
outerTireNumber: null,
|
|
|
|
outerTireNumber: null,
|
|
|
|
sensorId: "",
|
|
|
|
sensorId: "",
|
|
|
|
size: "",
|
|
|
|
size: "",
|
|
|
|
|
|
|
|
tyrePositionVal: "",
|
|
|
|
tyrePosition: "",
|
|
|
|
tyrePosition: "",
|
|
|
|
tyreiId:''
|
|
|
|
tyreiId: ''
|
|
|
|
}
|
|
|
|
}
|
|
|
|
nowClick.value = ''
|
|
|
|
nowClick.value = ''
|
|
|
|
const {data: res} = await setCarTyres({id: form.value.licenseNumber})
|
|
|
|
const {data: res} = await setCarTyres({id: form.value.licenseNumber})
|
|
|
|
tireArrangement.value = (res.carType?.split('T')[1]?.split('|').filter(e => e !== '') || []).map((res) => {
|
|
|
|
tireArrangement.value = (res.carType?.split('T')[1]?.split('|').filter(e => e !== '') || []).map((res) => {
|
|
|
|
return parseInt(res.split('-')[1])
|
|
|
|
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 => {
|
|
|
|
tireList.value = res.carTyresList.map(e => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
...e,
|
|
|
|
...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 = () => {
|
|
|
|
const outerTireNumberSearchClick = async () => {
|
|
|
|
console.log(form2.value.outerTireNumber)
|
|
|
|
const {data} = await getTyreInfo({outerTireNumber: form2.value.outerTireNumber})
|
|
|
|
}
|
|
|
|
let list = nowClick.value?.split('-').map(e => parseFloat(e))
|
|
|
|
|
|
|
|
let num = 0
|
|
|
|
const modifiedPatternDepth =() =>{
|
|
|
|
for (let i = 0; i < list?.[0] - 1; i++) {
|
|
|
|
console.log({
|
|
|
|
num += (tireArrangement.value[i] * 4)
|
|
|
|
currentTextureDepth:form2.value.currentTextureDepth,
|
|
|
|
}
|
|
|
|
tyreiId:form2.value.tyreiId,
|
|
|
|
if (list[1] === 1 && list[2] === 1) {
|
|
|
|
carLicense:licenseNumberOption.value.filter(e => e.value === form.value.licenseNumber)?.[0].label,
|
|
|
|
num += 4
|
|
|
|
id:form.value.licenseNumber
|
|
|
|
}
|
|
|
|
})
|
|
|
|
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) => {
|
|
|
|
const installClick = (e) => {
|
|
|
|
console.log(e === 1? '安装' :'更换')
|
|
|
|
let state = e
|
|
|
|
console.log({
|
|
|
|
if (!e) {
|
|
|
|
|
|
|
|
state = 1
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proxy.$refs["form22"].validate((valid) => {
|
|
|
|
|
|
|
|
if (valid) {
|
|
|
|
|
|
|
|
TyreInstall({
|
|
|
|
...form2.value,
|
|
|
|
...form2.value,
|
|
|
|
carLicense:licenseNumberOption.value.filter(e => e.value === form.value.licenseNumber)?.[0].label,
|
|
|
|
carLicense: licenseNumberOption.value.filter(e => e.value === form.value.licenseNumber)?.[0].label,
|
|
|
|
id:form.value.licenseNumber
|
|
|
|
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 = () => {
|
|
|
|
const uninstallClick = (val) => {
|
|
|
|
console.log({
|
|
|
|
if (form2.value.tyreId) {
|
|
|
|
tyreiId:form2.value.tyreiId,
|
|
|
|
TyreUnInstall({
|
|
|
|
carLicense:licenseNumberOption.value.filter(e => e.value === form.value.licenseNumber)?.[0].label,
|
|
|
|
...form2.value,
|
|
|
|
id:form.value.licenseNumber
|
|
|
|
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()
|
|
|
|
getList()
|
|
|
|