修改单车监控

master
夜笙歌 2 years ago
parent 084625263d
commit 39e8448f55

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询列表
export function listBasetyre(query) {
return request({
url: '/basetyre/tyre/list',
method: 'get',
params: query
})
}
// 查询基础信息详细
export function getBasetyre(id) {
return request({
url: '/basetyre/basetyre/' + id,
method: 'get'
})
}
// 新增信息
export function addBasetyre(data) {
return request({
url: '/basetyre/basetyre',
method: 'post',
data: data
})
}
// 修改信息
export function updateBasetyre(data) {
return request({
url: '/basetyre/basetyre',
method: 'put',
data: data
})
}
// 删除轮胎基础信息
export function delBasetyre(id) {
return request({
url: '/basetyre/basetyre/' + id,
method: 'delete'
})
}

@ -34,20 +34,39 @@
</span>
</div>
</div>
<div v-for="(item,index) in 5" key="index" style="margin-bottom: 18px">
<div v-for="(item,index) in TireRow" key="index" style="margin-bottom: 18px">
<div
style="width: 12.5%;margin: 0 12px; height: 100px;display: inline-block;border: 1px solid #666;border-radius: 10%">
style="vertical-align:top;width: 12.5%;margin: 0 12px; height: 100px;display: inline-block;border: 1px solid #666;border-radius: 10%">
<div style="border-radius: 10%;width:100%;height:100%;background-color:green;vertical-align:top" v-if="tyreDataList.includes(`${index+1}-1-1`)">
<div style="width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">花纹深度:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-1-1`))[0].currentTextureDepth}}</div>
<div style="width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">轮胎编号:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-1-1`))[0].outerTireNumber}}</div>
<div style="width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">花纹:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-1-1`))[0].pattern}}</div>
</div>
</div>
<div
style="width: 12.5%;margin: 0 12px; height: 100px;display: inline-block;border: 1px solid #666;border-radius: 10%">
<div :style="'width: 12.5%;margin: 0 12px; height: 100px;display: inline-block;border: 1px solid'+ (TireRow[index] === 2 ? '#666;' :'rgba(0,0,0,0);') + 'border-radius: 10%'">
<div style="border-radius: 10%;width:100%;height:100%;background-color:green;vertical-align:top" v-if="tyreDataList.includes(`${index+1}-1-2`)">
<div style="width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">花纹深度:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-1-2`))[0].currentTextureDepth}}</div>
<div style="width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">轮胎编号:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-1-2`))[0].outerTireNumber}}</div>
<div style="width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">花纹:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-1-2`))[0].pattern}}</div>
</div>
</div>
<img sizes="100% 100%" src="@/assets/images/zhou.png"
style="width: calc(50% - 108px);height: 100px;display: inline-block;vertical-align:top"/>
<div
style="width: 12.5%;margin: 0 12px; height: 100px;display: inline-block;border: 1px solid #666;border-radius: 10%">
:style="'width: 12.5%;margin: 0 12px; height: 100px;display: inline-block;border: 1px solid '+ (TireRow[index] === 2 ? '#666' :'rgba(0,0,0,0)') +';border-radius: 10%'">
<div style="border-radius: 10%;width:100%;height:100%;background-color:green;vertical-align:top" v-if="tyreDataList.includes(`${index+1}-2-2`)">
<div style="width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">花纹深度:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-2-2`))[0].currentTextureDepth}}</div>
<div style="width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">轮胎编号:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-2-2`))[0].outerTireNumber}}</div>
<div style="width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">花纹:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-2-2`))[0].pattern}}</div>
</div>
</div>
<div
style="width: 12.5%;margin: 0 12px; height: 100px;display: inline-block;border: 1px solid #666;border-radius: 10%">
<div style="border-radius: 10%;width:100%;height:100%;background-color:green;vertical-align:top" v-if="tyreDataList.includes(`${index+1}-2-1`)">
<div style="width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">花纹深度:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-2-1`))[0].currentTextureDepth}}</div>
<div style="width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">轮胎编号:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-2-1`))[0].outerTireNumber}}</div>
<div style="width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">花纹:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-2-1`))[0].pattern}}</div>
</div>
</div>
</div>
</el-col>
@ -116,6 +135,9 @@ import {onBeforeUnmount} from "@vue/runtime-core";
const {proxy} = getCurrentInstance();
const $router = useRouter();
const {t} = useI18n();
const TireRow = ref([])
const tyreList = ref([])
const tyreDataList = ref([])
const pageId = ref('')
const tableRef1 = ref()
let map = null
@ -177,11 +199,24 @@ const tableChange = async (e) => {
cardInfo.value = {
carLicense: info[0].carLicense
}
console.log(info)
let TireRow1 = info[0].cartype?.split('T')[1]?.split('|').filter(e => e !== '') || []
let title = []
TireRow1.forEach((res) => {
title.push(parseInt(res.split('-')[1]))
})
TireRow.value = title
let tyreListData = info[0].tyreList.map(e=>{
return {
...e,
tyrePositionS : e.tyrePosition?.split('-')[0] + '-' + e.tyrePosition?.split('-')[1] + '-' + e.tyrePosition?.split('-')[2]
}
})
tyreList.value = tyreListData
tyreDataList.value = tyreListData.map(e=>e.tyrePositionS)
console.log(tyreList.value)
let timeOut = () => {
setTimeout(() => {
if (map) {
console.log(111)
setMarker(info[0])
clearTimeout(timeOut)
}

@ -85,17 +85,6 @@
>{{ t('option.add') }}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['basetyre:basetyre:edit']"
>{{ t('option.edit') }}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
@ -125,11 +114,11 @@
<el-table-column type="selection" width="55" align="center" fixed/>
<!-- <el-table-column :label="t('tireManagement.tireFactoryCode')" align="center" prop="tyreFacCode" width="150"/>-->
<!-- <el-table-column :label="t('tireManagement.enterpriseCode')" align="center" prop="companyCode" width="150"/>-->
<el-table-column label="外胎号" align="center" prop="tureCode" width="150"/>
<el-table-column label="条码号" align="center" prop="tureCode" width="150"/>
<el-table-column label="品牌" align="center" prop="tureBrandId" width="150"/>
<el-table-column label="规格型号" align="center" prop="tureModel" width="150"/>
<el-table-column label="花纹" align="center" prop="tureModel" width="150"/>
<el-table-column label="外胎号" align="center" prop="outerDiameter" width="150"/>
<el-table-column label="条码号" align="center" prop="feCode" width="150"/>
<el-table-column label="品牌" align="center" prop="brand" width="150"/>
<el-table-column label="规格型号" align="center" prop="size" width="150"/>
<el-table-column label="花纹" align="center" prop="currentTextureDepth" width="150"/>
<!-- <el-table-column :label="t('tireManagement.carId')" align="center" prop="carId" width="150"/>-->
<el-table-column label="目前所安装车辆" align="center" prop="carLicense" width="150"/>
@ -164,13 +153,13 @@
v-hasPermi="['basetyre:basetyre:edit']"
>{{ t('option.edit') }}
</el-button>
<el-button
type="text"
icon="Delete"
@click="handleDelete(scope.row)"
v-hasPermi="['basetyre:basetyre:remove']"
>{{ t('option.remove') }}
</el-button>
<!-- <el-button-->
<!-- type="text"-->
<!-- icon="Delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['basetyre:basetyre:remove']"-->
<!-- >{{ t('option.remove') }}-->
<!-- </el-button>-->
</template>
</el-table-column>
</el-table>

@ -0,0 +1,405 @@
<template>
<div class="app-container">
<!-- 搜索栏-->
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch"
:label-width=" locale ? '100px':'140px'">
<el-form-item label="外胎号" prop="tureCode">
<el-input
v-model="queryParams.tureCode"
placeholder="请输入外胎号"
style="width: 200px"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="品牌" prop="tureCode">
<el-input
v-model="queryParams.tureCode"
placeholder="请输入品牌"
style="width: 200px"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="花纹" prop="tureCode">
<el-input
v-model="queryParams.tureCode"
placeholder="请输入花纹"
style="width: 200px"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="轮胎规格型号" prop="tureCode">
<el-input
v-model="queryParams.tureCode"
placeholder="请输入型号规格"
style="width: 200px"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="传感器编号" prop="sensorId">
<el-input
v-model="queryParams.sensorId"
placeholder="请输入传感器编号"
style="width: 200px"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="车牌号" prop="sensorId">
<el-input
v-model="queryParams.sensorId"
placeholder="请输入车牌号"
style="width: 200px"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建时间" style="width: 308px;">
<el-date-picker
v-model="dateRange"
value-format="YYYY-MM-DD"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" icon="Search" @click="handleQuery">{{ t('option.search') }}</el-button>
<el-button icon="Refresh" @click="resetQuery">{{ t('option.reset') }}</el-button>
</el-form-item>
</el-form>
<!-- 顶部操作按钮-->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
@click="handleAdd"
v-hasPermi="['basetyre:basetyre:add']"
>{{ t('option.add') }}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['basetyre:basetyre:remove']"
>{{ t('option.remove') }}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
v-hasPermi="['basetyre:basetyre:export']"
>{{ t('option.export') }}
</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 表格主体-->
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" fixed/>
<el-table-column label="轮胎厂名称" align="center" prop="tyreFactory" width="150"/>
<el-table-column label="外胎号" align="center" prop="outerTireNumber" width="150"/>
<el-table-column label="物料编码" align="center" prop="materialCode" width="150"/>
<el-table-column label="物料名称" align="center" prop="materialName" width="150"/>
<el-table-column label="质控状态" align="center" prop="qualityStatus" width="150"/>
<el-table-column label="单位" align="center" prop="unit" width="150"/>
<el-table-column label="品牌" align="center" prop="brand" width="150"/>
<el-table-column label="规格" align="center" prop="size" width="150"/>
<el-table-column label="花纹" align="center" prop="pattern" width="150"/>
<el-table-column label="层级" align="center" prop="hierarchy" width="150"/>
<el-table-column label="速度级别" align="center" prop="speedLevel" width="150"/>
<el-table-column label="负荷指数" align="center" prop="loadIndex" width="150"/>
<el-table-column label="轮辋尺寸" align="center" prop="rimSize" width="150"/>
<el-table-column label="标准重量" align="center" prop="weight" width="150"/>
<el-table-column label="断面宽" align="center" prop="sectionWidth" width="150"/>
<el-table-column label="外直径" align="center" prop="outerDiameter" width="150"/>
<el-table-column label="扁平率" align="center" prop="flattening" width="150"/>
<el-table-column label="加强型" align="center" prop="enhanced" width="150"/>
<el-table-column label="有无内胎" align="center" prop="innerTube" width="150"/>
<el-table-column label="装箱量" align="center" prop="ctn" width="150"/>
<el-table-column label="轮胎类型" align="center" prop="type" width="150"/>
<el-table-column label="认证信息" align="center" prop="certInfo" width="150"/>
<el-table-column label="报关规格" align="center" prop="customsSpe" width="150"/>
<el-table-column label="胎胚编码" align="center" prop="feCode" width="150"/>
<el-table-column label="胎胚描述" align="center" prop="feDesc" width="150"/>
<el-table-column label="生产工厂" align="center" prop="produceFactory" width="150"/>
<el-table-column :label="t('option.option')" align="center" class-name="small-padding fixed-width" fixed="right"
width="160">
<template #default="scope">
<el-button
type="text"
icon="Edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['basetyre:basetyre:edit']"
>{{ t('option.edit') }}
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页-->
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改岗位对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="postRef" :model="form" :rules="rules" :label-width=" locale ? '100px':'140px'">
<el-form-item prop="id" v-if="false">
<el-input v-model="form.id"/>
</el-form-item>
<el-form-item :label="t('tireManagement.tireNo')" prop="tureCode">
<el-input v-model="form.tureCode" :placeholder="t('common.pleaseEnter') + t('tireManagement.tireNo')" />
</el-form-item>
<el-form-item label="品牌" prop="tureCode">
<el-input v-model="form.tureCode" />
</el-form-item>
<el-form-item label="花纹" prop="tureCode">
<el-input v-model="form.tureCode" />
</el-form-item>
<el-form-item label="规格型号" prop="tureCode">
<el-input v-model="form.tureCode" />
</el-form-item>
<el-form-item :label="t('tireManagement.tireSensorID')" prop="sensorId">
<el-input v-model="form.sensorId" :placeholder="t('common.pleaseEnter') + t('tireManagement.tireSensorID')"/>
</el-form-item>
<el-form-item :label="t('tireManagement.treadDepth')" prop="currentTextureDepth">
<el-input-number
v-model="form.currentTextureDepth"
autocomplete="off"
:min="0"
:max="99"
:step="0.1"
:precision="2"
/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm">{{ t('option.ok') }}</el-button>
<el-button @click="cancel">{{ t('option.cancel') }}</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="basetyre">
import {addBasetyre, delBasetyre, getBasetyre, listBasetyre, updateBasetyre} from "@/api/tireManagement/salesData";
import {useI18n} from 'vue-i18n';
import Cookies from "js-cookie";
const {t} = useI18n();
const locale = (Cookies.get('language') || 'zhCn') === 'zhCn'
const {proxy} = getCurrentInstance();
const {sys_normal_disable} = proxy.useDict("sys_normal_disable");
//
const postList = ref([]);
const dateRange = ref([]);
//
const open = ref(false);
//
const loading = ref(true);
//
const showSearch = ref(true);
// id
const ids = ref([]);
//
const single = ref(true);
//
const multiple = ref(true);
//
const total = ref(0);
//
const title = ref("");
//
const queryParams = ref({
pageNum: 1,
pageSize: 10,
tyreFacCode: null,
companyCode: null,
carId: null,
carLicense: null,
tureCode: null,
tureModel: null,
tureModelId: null,
tureBrandId: null,
tyreRfid: null,
tyrePosition: null,
sensorId: null,
currentTextureDepth: null,
state: null,
isDelete: null,
createId: null,
createName: null,
modifyTime: null,
modifyId: null,
modifyBy: null,
modifyName: null
})
//
const rules = {
tureCode: [{required: true, message: "外胎号不能为空", trigger: "blur"}],
type: [{required: true, message: "轮胎型号不能为空", trigger: "blur"}],
serialNumber: [{required: true, message: "轮胎编号不能为空", trigger: "blur"}],
}
//
const form = ref({});
/** 查询岗位列表 */
function getList() {
loading.value = true;
listBasetyre(queryParams.value).then(response => {
postList.value = response.rows;
total.value = response.total;
}).finally(() => {
loading.value = false;
});
}
/** 取消按钮 */
function cancel() {
open.value = false;
reset();
}
/** 表单重置 */
function reset() {
form.value = {
id: null,
tyreFacCode: null,
companyCode: null,
carId: null,
carLicense: null,
tureCode: null,
tureModel: null,
tureModelId: null,
tureBrandId: null,
tyreRfid: null,
tyrePosition: null,
sensorId: null,
currentTextureDepth: null,
state: null,
isDelete: null,
createTime: null,
createId: null,
createBy: null,
createName: null,
modifyTime: null,
modifyId: null,
modifyBy: null,
modifyName: null
};
proxy.resetForm("postRef");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
proxy.resetForm("queryRef");
handleQuery();
}
/** 多选框选中数据 */
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.id);
single.value = selection.length !== 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = t('tireManagement.addTitle');
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
const postId = row.id || ids.value;
getBasetyre(postId).then(response => {
form.value = response.data;
open.value = true;
title.value = t('tireManagement.editTitle');
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["postRef"].validate(valid => {
if (valid) {
if (form.value.id != undefined) {
updateBasetyre(form.value).then(response => {
proxy.$modal.msgSuccess(t('option.modificationSuccessful'));
open.value = false;
getList();
});
} else {
addBasetyre(form.value).then(response => {
proxy.$modal.msgSuccess(t('option.addedSuccessfully'));
open.value = false;
getList();
});
}
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const postIds = row.id || ids.value;
proxy.$modal.confirm(t('option.confirmDeletion', {
key: t('tireManagement.tireFactoryCode'),
value: postIds
})).then(function () {
return delBasetyre(postIds);
}).then(() => {
getList();
proxy.$modal.msgSuccess(t('option.successfullyDeleted'));
}).catch(() => {
});
}
/** 导出按钮操作 */
function handleExport() {
proxy.download("system/post/export", {
...queryParams.value
}, `post_${new Date().getTime()}.xlsx`);
}
getList();
</script>
Loading…
Cancel
Save