添加设备信息界面

master
夜笙歌 2 years ago
parent 02bbee1a50
commit 7381b5f51b

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

@ -101,9 +101,7 @@ export default {
trailerNum: 'Trailer Num', trailerNum: 'Trailer Num',
addTitle: 'Add Vehicle Type', addTitle: 'Add Vehicle Type',
editTitle: 'Modify Vehicle Type', editTitle: 'Modify Vehicle Type',
}
}, },
carQueue: {
carQueue: { carQueue: {
tyreFacCode: 'Tire Factory Code', tyreFacCode: 'Tire Factory Code',
companyCode: 'Enterprise number', companyCode: 'Enterprise number',
@ -114,5 +112,19 @@ export default {
addTitle: 'Add Motorcade', addTitle: 'Add Motorcade',
editTitle: 'Modify Motorcade', editTitle: 'Modify Motorcade',
} }
},
baseDevice: {
baseDevice: {
tyreFacCode: 'Tire Factory Code',
companyCode: 'Enterprise number',
internetThingsNo: 'IoT Card Number',
simCode: 'sim Code',
deviceType: 'Equipment Type',
state: 'State',
activeTime: 'Activation Time',
lastRunTime: 'Last Run Time',
addTitle: 'Add Device Information',
editTitle: 'Modify Device Information',
}
} }
} }

@ -101,9 +101,7 @@ export default {
trailerNum: '布局挂数', trailerNum: '布局挂数',
addTitle: '添加车辆类型', addTitle: '添加车辆类型',
editTitle: '修改车辆类型', editTitle: '修改车辆类型',
}
}, },
carQueue: {
carQueue: { carQueue: {
tyreFacCode: '轮胎厂编码', tyreFacCode: '轮胎厂编码',
companyCode: '企业编码', companyCode: '企业编码',
@ -114,5 +112,19 @@ export default {
addTitle: '添加车队', addTitle: '添加车队',
editTitle: '修改车队', editTitle: '修改车队',
} }
},
baseDevice: {
baseDevice: {
tyreFacCode: '轮胎厂编码',
companyCode: '企业编码',
internetThingsNo: '物联卡卡号',
simCode: 'sim卡识别码',
deviceType: '设备类型',
state: '状态',
activeTime: '激活时间',
lastRunTime: '最后通讯时间',
addTitle: '添加设备信息',
editTitle: '修改设备信息',
}
} }
} }

@ -3,55 +3,55 @@
<!-- 搜索栏--> <!-- 搜索栏-->
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch"
:label-width=" locale ? '90px':'140px'"> :label-width=" locale ? '90px':'140px'">
<el-form-item :label="t('carQueue.carQueue.tyreFacCode')" prop="tyreFacCode"> <el-form-item :label="t('baseCar.carQueue.tyreFacCode')" prop="tyreFacCode">
<el-input <el-input
v-model="queryParams.tyreFacCode" v-model="queryParams.tyreFacCode"
:placeholder=" t('common.pleaseEnter') + t('carQueue.carQueue.tyreFacCode')" :placeholder=" t('common.pleaseEnter') + t('baseCar.carQueue.tyreFacCode')"
style="width: 200px" style="width: 200px"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="t('carQueue.carQueue.companyCode')" prop="companyCode"> <el-form-item :label="t('baseCar.carQueue.companyCode')" prop="companyCode">
<el-input <el-input
v-model="queryParams.companyCode" v-model="queryParams.companyCode"
:placeholder="t('common.pleaseEnter') + t('carQueue.carQueue.companyCode')" :placeholder="t('common.pleaseEnter') + t('baseCar.carQueue.companyCode')"
style="width: 200px" style="width: 200px"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="t('carQueue.carQueue.title')" prop="title"> <el-form-item :label="t('baseCar.carQueue.title')" prop="title">
<el-input <el-input
v-model="queryParams.title" v-model="queryParams.title"
:placeholder="t('common.pleaseEnter') + t('carQueue.carQueue.title')" :placeholder="t('common.pleaseEnter') + t('baseCar.carQueue.title')"
style="width: 200px" style="width: 200px"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="t('carQueue.carQueue.state')" prop="state"> <el-form-item :label="t('baseCar.carQueue.state')" prop="state">
<el-input <el-input
v-model="queryParams.state" v-model="queryParams.state"
:placeholder="t('common.pleaseEnter') + t('carQueue.carQueue.state')" :placeholder="t('common.pleaseEnter') + t('baseCar.carQueue.state')"
style="width: 200px" style="width: 200px"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="t('carQueue.carQueue.groupTotal')" prop="groupTotal"> <el-form-item :label="t('baseCar.carQueue.groupTotal')" prop="groupTotal">
<el-input <el-input
v-model="queryParams.groupTotal" v-model="queryParams.groupTotal"
:placeholder="t('common.pleaseEnter') +t('carQueue.carQueue.groupTotal')" :placeholder="t('common.pleaseEnter') +t('baseCar.carQueue.groupTotal')"
style="width: 200px" style="width: 200px"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="t('carQueue.carQueue.carTotal')" prop="carTotal"> <el-form-item :label="t('baseCar.carQueue.carTotal')" prop="carTotal">
<el-input <el-input
v-model="queryParams.carTotal" v-model="queryParams.carTotal"
:placeholder="t('common.pleaseEnter') + t('carQueue.carQueue.carTotal')" :placeholder="t('common.pleaseEnter') + t('baseCar.carQueue.carTotal')"
style="width: 200px" style="width: 200px"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
@ -198,13 +198,13 @@
<!-- 表格主体--> <!-- 表格主体-->
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" fixed/> <el-table-column type="selection" width="55" align="center" fixed/>
<el-table-column :label="t('carQueue.carQueue.tyreFacCode')" align="center" prop="tyreFacCode" width="150"/> <el-table-column :label="t('baseCar.carQueue.tyreFacCode')" align="center" prop="tyreFacCode" width="150"/>
<el-table-column :label="t('carQueue.carQueue.companyCode')" align="center" prop="companyCode" width="150"/> <el-table-column :label="t('baseCar.carQueue.companyCode')" align="center" prop="companyCode" width="150"/>
<el-table-column :label="t('carQueue.carQueue.title')" align="center" prop="title" width="150"/> <el-table-column :label="t('baseCar.carQueue.title')" align="center" prop="title" width="150"/>
<el-table-column :label="t('carQueue.carQueue.state')" align="center" prop="state" width="150"/> <el-table-column :label="t('baseCar.carQueue.state')" align="center" prop="state" width="150"/>
<el-table-column :label="t('carQueue.carQueue.groupTotal')" align="center" prop="groupTotal" <el-table-column :label="t('baseCar.carQueue.groupTotal')" align="center" prop="groupTotal"
width="150"/> width="150"/>
<el-table-column :label="t('carQueue.carQueue.carTotal')" align="center" prop="carTotal" <el-table-column :label="t('baseCar.carQueue.carTotal')" align="center" prop="carTotal"
width="150"/> width="150"/>
<el-table-column :label="t('common.isRemove')" align="center" prop="isDelete" width="150"/> <el-table-column :label="t('common.isRemove')" align="center" prop="isDelete" width="150"/>
<el-table-column :label="t('common.createTime')" align="center" prop="createTime" width="160"/> <el-table-column :label="t('common.createTime')" align="center" prop="createTime" width="160"/>
@ -251,35 +251,35 @@
<el-form-item prop="id" v-if="false"> <el-form-item prop="id" v-if="false">
<el-input v-model="form.id"/> <el-input v-model="form.id"/>
</el-form-item> </el-form-item>
<el-form-item :label="t('carQueue.carQueue.tyreFacCode')" prop="tyreFacCode"> <el-form-item :label="t('baseCar.carQueue.tyreFacCode')" prop="tyreFacCode">
<el-input <el-input
v-model="form.tyreFacCode" v-model="form.tyreFacCode"
:placeholder="t('common.pleaseEnter') + t('carQueue.carQueue.tyreFacCode')"/> :placeholder="t('common.pleaseEnter') + t('baseCar.carQueue.tyreFacCode')"/>
</el-form-item> </el-form-item>
<el-form-item :label="t('carQueue.carQueue.companyCode')" prop="companyCode"> <el-form-item :label="t('baseCar.carQueue.companyCode')" prop="companyCode">
<el-input <el-input
v-model="form.companyCode" v-model="form.companyCode"
:placeholder="t('common.pleaseEnter') + t('carQueue.carQueue.companyCode')"/> :placeholder="t('common.pleaseEnter') + t('baseCar.carQueue.companyCode')"/>
</el-form-item> </el-form-item>
<el-form-item :label="t('carQueue.carQueue.title')" prop="title"> <el-form-item :label="t('baseCar.carQueue.title')" prop="title">
<el-input <el-input
v-model="form.title" v-model="form.title"
:placeholder="t('common.pleaseEnter') + t('carQueue.carQueue.title')"/> :placeholder="t('common.pleaseEnter') + t('baseCar.carQueue.title')"/>
</el-form-item> </el-form-item>
<el-form-item :label="t('carQueue.carQueue.state')" prop="state"> <el-form-item :label="t('baseCar.carQueue.state')" prop="state">
<el-input <el-input
v-model="form.state" v-model="form.state"
:placeholder="t('common.pleaseEnter') + t('carQueue.carQueue.state')"/> :placeholder="t('common.pleaseEnter') + t('baseCar.carQueue.state')"/>
</el-form-item> </el-form-item>
<el-form-item :label="t('carQueue.carQueue.groupTotal')" prop="groupTotal"> <el-form-item :label="t('baseCar.carQueue.groupTotal')" prop="groupTotal">
<el-input <el-input
v-model="form.groupTotal" v-model="form.groupTotal"
:placeholder="t('common.pleaseEnter') + t('carQueue.carQueue.groupTotal')"/> :placeholder="t('common.pleaseEnter') + t('baseCar.carQueue.groupTotal')"/>
</el-form-item> </el-form-item>
<el-form-item :label="t('carQueue.carQueue.carTotal')" prop="carTotal"> <el-form-item :label="t('baseCar.carQueue.carTotal')" prop="carTotal">
<el-input <el-input
v-model="form.carTotal" v-model="form.carTotal"
:placeholder="t('common.pleaseEnter') + t('carQueue.carQueue.carTotal')"/> :placeholder="t('common.pleaseEnter') + t('baseCar.carQueue.carTotal')"/>
</el-form-item> </el-form-item>
<el-form-item :label="t('common.isRemove')" prop="isDelete"> <el-form-item :label="t('common.isRemove')" prop="isDelete">
<el-input <el-input
@ -357,7 +357,6 @@ const {t} = useI18n();
const locale = (Cookies.get('language') || 'zh-cn') === 'zh-cn' const locale = (Cookies.get('language') || 'zh-cn') === 'zh-cn'
const {proxy} = getCurrentInstance(); const {proxy} = getCurrentInstance();
const {sys_normal_disable} = proxy.useDict("sys_normal_disable");
// //
@ -491,7 +490,7 @@ function handleSelectionChange(selection) {
function handleAdd() { function handleAdd() {
reset(); reset();
open.value = true; open.value = true;
title.value = t('carQueue.carQueue.addTitle'); title.value = t('baseCar.carQueue.addTitle');
} }
/** 修改按钮操作 */ /** 修改按钮操作 */
@ -501,7 +500,7 @@ function handleUpdate(row) {
getCarQueue(postId).then(response => { getCarQueue(postId).then(response => {
form.value = response.data; form.value = response.data;
open.value = true; open.value = true;
title.value = t('carQueue.carQueue.editTitle'); title.value = t('baseCar.carQueue.editTitle');
}); });
} }
@ -530,7 +529,8 @@ function submitForm() {
function handleDelete(row) { function handleDelete(row) {
const postIds = row.postId || ids.value; const postIds = row.postId || ids.value;
proxy.$modal.confirm(t('option.confirmDeletion', { proxy.$modal.confirm(t('option.confirmDeletion', {
key: t('carQueue.carQueue.tyreFacCode'), value: postIds key: t('baseCar.carQueue.tyreFacCode'),
value: postIds
})).then(function () { })).then(function () {
return delCarQueue(postIds); return delCarQueue(postIds);
}).then(() => { }).then(() => {

@ -0,0 +1,610 @@
<template>
<div class="app-container">
<!-- 搜索栏-->
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch"
:label-width=" locale ? '90px':'140px'">
<el-form-item :label="t('baseDevice.baseDevice.tyreFacCode')" prop="tyreFacCode">
<el-input
v-model="queryParams.tyreFacCode"
:placeholder=" t('common.pleaseEnter') + t('baseDevice.baseDevice.tyreFacCode')"
style="width: 200px"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="t('baseDevice.baseDevice.companyCode')" prop="companyCode">
<el-input
v-model="queryParams.companyCode"
:placeholder="t('common.pleaseEnter') + t('baseDevice.baseDevice.companyCode')"
style="width: 200px"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="t('baseDevice.baseDevice.internetThingsNo')" prop="internetThingsNo">
<el-input
v-model="queryParams.internetThingsNo"
:placeholder="t('common.pleaseEnter') + t('baseDevice.baseDevice.internetThingsNo')"
style="width: 200px"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="t('baseDevice.baseDevice.simCode')" prop="simCode">
<el-input
v-model="queryParams.simCode"
:placeholder="t('common.pleaseEnter') + t('baseDevice.baseDevice.simCode')"
style="width: 200px"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="t('baseDevice.baseDevice.deviceType')" prop="deviceType">
<el-input
v-model="queryParams.deviceType"
:placeholder="t('common.pleaseEnter') +t('baseDevice.baseDevice.deviceType')"
style="width: 200px"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="t('baseDevice.baseDevice.state')" prop="state">
<el-input
v-model="queryParams.state"
:placeholder="t('common.pleaseEnter') + t('baseDevice.baseDevice.state')"
style="width: 200px"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="t('baseDevice.baseDevice.activeTime')" prop="activeTime">
<el-date-picker
clearable
style="width: 200px"
v-model="queryParams.activeTime"
:placeholder="t('common.PleaseSelect') + t('baseDevice.baseDevice.activeTime')"
type="date"
format="YYYY/MM/DD"
value-format="YYYY-MM-DD"
/>
</el-form-item>
<el-form-item :label="t('baseDevice.baseDevice.lastRunTime')" prop="lastRunTime">
<el-date-picker
clearable
style="width: 200px"
v-model="queryParams.lastRunTime"
:placeholder="t('common.PleaseSelect') + t('baseDevice.baseDevice.lastRunTime')"
type="date"
format="YYYY/MM/DD"
value-format="YYYY-MM-DD"
/>
</el-form-item>
<el-form-item :label="t('common.isRemove')" prop="isDelete">
<el-input
v-model="queryParams.isDelete"
:placeholder="t('common.pleaseEnter') + t('common.isRemove')"
style="width: 200px"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="t('common.createTime')" prop="createTime">
<el-date-picker
clearable
style="width: 200px"
v-model="queryParams.createTime"
:placeholder="t('common.PleaseSelect') + t('common.createTime')"
type="date"
format="YYYY/MM/DD"
value-format="YYYY-MM-DD"
/>
</el-form-item>
<el-form-item :label="t('common.creatorId')" prop="createId">
<el-input
v-model="queryParams.createId"
:placeholder="t('common.pleaseEnter') + t('common.creatorId')"
style="width: 200px"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="t('common.createBy')" prop="createBy">
<el-input
v-model="queryParams.createBy"
:placeholder="t('common.pleaseEnter') + t('common.createBy')"
style="width: 200px"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="t('common.creatorName')" prop="createName">
<el-input
v-model="queryParams.createName"
:placeholder="t('common.pleaseEnter') + t('common.creatorName')"
style="width: 200px"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="t('common.editTime')" prop="modifyTime">
<el-date-picker
clearable
style="width: 200px"
v-model="queryParams.modifyTime"
:placeholder="t('common.PleaseSelect') + t('common.editTime')"
type="date"
format="YYYY/MM/DD"
value-format="YYYY-MM-DD"
/>
</el-form-item>
<el-form-item :label="t('common.editID')" prop="modifyId">
<el-input
v-model="queryParams.modifyId"
:placeholder="t('common.pleaseEnter') + t('common.editID')"
style="width: 200px"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="t('common.editBy')" prop="modifyBy">
<el-input
v-model="queryParams.modifyBy"
:placeholder="t('common.pleaseEnter') + t('common.editBy')"
style="width: 200px"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="t('common.editName')" prop="modifyName">
<el-input
v-model="queryParams.modifyName"
:placeholder="t('common.pleaseEnter') + t('common.editName')"
style="width: 200px"
clearable
@keyup.enter.native="handleQuery"
/>
</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="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"
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="t('baseDevice.baseDevice.tyreFacCode')" align="center" prop="tyreFacCode" width="150"/>
<el-table-column :label="t('baseDevice.baseDevice.companyCode')" align="center" prop="companyCode" width="150"/>
<el-table-column :label="t('baseDevice.baseDevice.internetThingsNo')" align="center" prop="internetThingsNo"
width="150"/>
<el-table-column :label="t('baseDevice.baseDevice.simCode')" align="center" prop="simCode" width="150"/>
<el-table-column :label="t('baseDevice.baseDevice.deviceType')" align="center" prop="deviceType"
width="150"/>
<el-table-column :label="t('baseDevice.baseDevice.state')" align="center" prop="state"
width="150"/>
<el-table-column :label="t('baseDevice.baseDevice.activeTime')" align="center" prop="activeTime"
width="150"/>
<el-table-column :label="t('baseDevice.baseDevice.lastRunTime')" align="center" prop="lastRunTime"
width="150"/>
<el-table-column :label="t('common.isRemove')" align="center" prop="isDelete" width="150"/>
<el-table-column :label="t('common.createTime')" align="center" prop="createTime" width="160"/>
<el-table-column :label="t('common.creatorId')" align="center" prop="createId" width="150"/>
<el-table-column :label="t('common.createBy')" align="center" prop="createBy" width="150"/>
<el-table-column :label="t('common.creatorName')" align="center" prop="createName" width="150"/>
<el-table-column :label="t('common.editTime')" align="center" prop="modifyTime" width="150"/>
<el-table-column :label="t('common.editID')" align="center" prop="modifyId" width="150"/>
<el-table-column :label="t('common.editBy')" align="center" prop="modifyBy" width="150"/>
<el-table-column :label="t('common.editName')" align="center" prop="modifyName" 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>
<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>
<!-- 分页-->
<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 ? '90px':'140px'">
<el-form-item prop="id" v-if="false">
<el-input v-model="form.id"/>
</el-form-item>
<el-form-item :label="t('baseDevice.baseDevice.tyreFacCode')" prop="tyreFacCode">
<el-input
v-model="form.tyreFacCode"
:placeholder="t('common.pleaseEnter') + t('baseDevice.baseDevice.tyreFacCode')"/>
</el-form-item>
<el-form-item :label="t('baseDevice.baseDevice.companyCode')" prop="companyCode">
<el-input
v-model="form.companyCode"
:placeholder="t('common.pleaseEnter') + t('baseDevice.baseDevice.companyCode')"/>
</el-form-item>
<el-form-item :label="t('baseDevice.baseDevice.internetThingsNo')" prop="internetThingsNo">
<el-input
v-model="form.internetThingsNo"
:placeholder="t('common.pleaseEnter') + t('baseDevice.baseDevice.internetThingsNo')"/>
</el-form-item>
<el-form-item :label="t('baseDevice.baseDevice.simCode')" prop="simCode">
<el-input
v-model="form.simCode"
:placeholder="t('common.pleaseEnter') + t('baseDevice.baseDevice.simCode')"/>
</el-form-item>
<el-form-item :label="t('baseDevice.baseDevice.deviceType')" prop="deviceType">
<el-input
v-model="form.deviceType"
:placeholder="t('common.pleaseEnter') + t('baseDevice.baseDevice.deviceType')"/>
</el-form-item>
<el-form-item :label="t('baseDevice.baseDevice.state')" prop="state">
<el-input
v-model="form.state"
:placeholder="t('common.pleaseEnter') + t('baseDevice.baseDevice.state')"/>
</el-form-item>
<el-form-item :label="t('baseDevice.baseDevice.activeTime')" prop="activeTime">
<el-date-picker
clearable
v-model="form.activeTime"
type="date"
format="YYYY/MM/DD"
value-format="YYYY-MM-DD"
:placeholder="t('common.PleaseSelect') + t('baseDevice.baseDevice.activeTime')"
/>
</el-form-item>
<el-form-item :label="t('baseDevice.baseDevice.lastRunTime')" prop="lastRunTime">
<el-date-picker
clearable
v-model="form.lastRunTime"
type="date"
format="YYYY/MM/DD"
value-format="YYYY-MM-DD"
:placeholder="t('common.PleaseSelect') + t('baseDevice.baseDevice.lastRunTime')"
/>
</el-form-item>
<el-form-item :label="t('common.isRemove')" prop="isDelete">
<el-input
v-model="form.isDelete"
:placeholder="t('common.pleaseEnter') + t('common.isRemove')"/>
</el-form-item>
<el-form-item :label="t('common.createTime')" prop="createTime">
<el-date-picker
clearable
v-model="form.createTime"
type="date"
format="YYYY/MM/DD"
value-format="YYYY-MM-DD"
:placeholder="t('common.PleaseSelect') + t('common.createTime')"
/>
</el-form-item>
<el-form-item :label="t('common.creatorId')" prop="createId">
<el-input
v-model="form.createId"
:placeholder="t('common.pleaseEnter') + t('common.creatorId')"/>
</el-form-item>
<el-form-item :label="t('common.createBy')" prop="createBy">
<el-input
v-model="form.createBy"
:placeholder="t('common.pleaseEnter') + t('common.createBy')"/>
</el-form-item>
<el-form-item :label="t('common.creatorName')" prop="createName">
<el-input
v-model="form.createName"
:placeholder="t('common.pleaseEnter') + t('common.creatorName')"/>
</el-form-item>
<el-form-item :label="t('common.editTime')" prop="modifyTime">
<el-date-picker
clearable
v-model="form.modifyTime"
type="date"
format="YYYY/MM/DD"
value-format="YYYY-MM-DD"
:placeholder="t('common.PleaseSelect') + t('common.editTime')"
/>
</el-form-item>
<el-form-item :label="t('common.editID')" prop="modifyId">
<el-input
v-model="form.modifyId"
:placeholder="t('common.pleaseEnter') + t('common.editID')"/>
</el-form-item>
<el-form-item :label="t('common.editBy')" prop="modifyBy">
<el-input
v-model="form.modifyBy"
:placeholder="t('common.pleaseEnter') + t('common.editBy')"/>
</el-form-item>
<el-form-item :label="t('common.editName')" prop="modifyName">
<el-input
v-model="form.modifyName"
:placeholder="t('common.pleaseEnter') + t('common.editName')"/>
</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="CarQueue">
import {
addBaseDevice,
delBaseDevice,
getBaseDevice,
listBaseDevice,
updateBaseDevice
} from "@/api/basedevice/basedevice";
import {useI18n} from 'vue-i18n';
import Cookies from "js-cookie";
const {t} = useI18n();
const locale = (Cookies.get('language') || 'zh-cn') === 'zh-cn'
const {proxy} = getCurrentInstance();
//
const postList = 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: undefined,
companyCode: undefined,
internetThingsNo: undefined,
simCode: undefined,
deviceType: undefined,
state: undefined,
activeTime: undefined,
lastRunTime: undefined,
isDelete: undefined,
createTime: undefined,
createId: undefined,
createBy: undefined,
createName: undefined,
modifyTime: undefined,
modifyId: undefined,
modifyBy: undefined,
modifyName: undefined,
})
//
const rules = {
brand: [{required: true, message: "轮胎品牌不能为空", trigger: "blur"}],
type: [{required: true, message: "轮胎型号不能为空", trigger: "blur"}],
serialNumber: [{required: true, message: "轮胎编号不能为空", trigger: "blur"}],
depth: [{required: true, message: "花纹深度不能为空", trigger: "blur"}],
}
//
const form = ref({
id: null,
tyreFacCode: null,
companyCode: null,
internetThingsNo: null,
simCode: null,
deviceType: null,
state: null,
activeTime: null,
lastRunTime: null,
isDelete: null,
createTime: null,
createId: null,
createBy: null,
createName: null,
modifyTime: null,
modifyId: null,
modifyBy: null,
modifyName: null,
});
/** 查询岗位列表 */
function getList() {
loading.value = true;
listBaseDevice(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,
internetThingsNo: null,
simCode: null,
deviceType: null,
state: null,
activeTime: null,
lastRunTime: 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('baseDevice.baseDevice.addTitle');
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
const postId = row.id || ids.value;
getBaseDevice(postId).then(response => {
form.value = response.data;
open.value = true;
title.value = t('baseDevice.baseDevice.editTitle');
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["postRef"].validate(valid => {
if (valid) {
if (form.value.id != undefined) {
updateBaseDevice(form.value).then(response => {
proxy.$modal.msgSuccess(t('option.modificationSuccessful'));
open.value = false;
getList();
});
} else {
addBaseDevice(form.value).then(response => {
proxy.$modal.msgSuccess(t('option.addedSuccessfully'));
open.value = false;
getList();
});
}
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const postIds = row.postId || ids.value;
proxy.$modal.confirm(t('option.confirmDeletion', {
key: t('baseDevice.baseDevice.tyreFacCode'),
value: postIds
})).then(function () {
return delBaseDevice(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