修改单车监控界面

master
夜笙歌 2 years ago
parent 7dc7afe4d6
commit 18c0474847

@ -140,7 +140,7 @@
:placeholder="t('common.pleaseEnter') + t('baseCar.carQueue.title')"/> :placeholder="t('common.pleaseEnter') + t('baseCar.carQueue.title')"/>
</el-form-item> </el-form-item>
<el-form-item :label="t('baseCar.carQueue.state')" prop="state"> <el-form-item :label="t('baseCar.carQueue.state')" prop="state">
<el-switch v-model="form.state"/> <el-switch v-model="form.state" :active-value="0" :inactive-value="1"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
@ -206,7 +206,7 @@ const rules = {
const form = ref({ const form = ref({
id: null, id: null,
title: null, title: null,
state: true, state: 0,
}); });
/** 查询岗位列表 */ /** 查询岗位列表 */
@ -239,7 +239,7 @@ function reset() {
form.value = { form.value = {
id: null, id: null,
title: null, title: null,
state: true, state: 0,
}; };
proxy.resetForm("postRef"); proxy.resetForm("postRef");
} }
@ -276,7 +276,6 @@ function handleUpdate(row) {
const postId = row.id || ids.value; const postId = row.id || ids.value;
getCarQueue(postId).then(response => { getCarQueue(postId).then(response => {
form.value = response.data; form.value = response.data;
form.value.state = response.data.state === 1
open.value = true; open.value = true;
title.value = t('baseCar.carQueue.editTitle'); title.value = t('baseCar.carQueue.editTitle');
}); });
@ -285,7 +284,6 @@ function handleUpdate(row) {
/** 提交按钮 */ /** 提交按钮 */
function submitForm() { function submitForm() {
let params = form.value let params = form.value
params.state = params.state ? 1 : 0
proxy.$refs["postRef"].validate(valid => { proxy.$refs["postRef"].validate(valid => {
if (valid) { if (valid) {
if (params.id != undefined) { if (params.id != undefined) {

@ -117,7 +117,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="是否启用" prop="state"> <el-form-item label="是否启用" prop="state">
<el-switch v-model="form.state"/> <el-switch v-model="form.state" :active-value="0" :inactive-value="1"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="width: 100%;text-align: center;height: 50px;line-height: 50px">轮胎布局图</div> <div style="width: 100%;text-align: center;height: 50px;line-height: 50px">轮胎布局图</div>
@ -265,7 +265,7 @@ const queryParams = ref({
companyCode: undefined, companyCode: undefined,
code: undefined, code: undefined,
title: undefined, title: undefined,
state: undefined, state: 0,
axleTotal: undefined, axleTotal: undefined,
tyreTotal: undefined, tyreTotal: undefined,
isDelete: undefined, isDelete: undefined,
@ -292,7 +292,7 @@ const rules = {
const form = ref({ const form = ref({
id: null, id: null,
axleTotal: 2, axleTotal: 2,
state: true, state: 0,
}); });
/** 查询岗位列表 */ /** 查询岗位列表 */
@ -317,7 +317,7 @@ function reset() {
form.value = { form.value = {
id: null, id: null,
axleTotal: 2, axleTotal: 2,
state: true, state: 0,
}; };
TireRowInfo.value = [1, 1] TireRowInfo.value = [1, 1]
proxy.resetForm("postRef"); proxy.resetForm("postRef");
@ -355,7 +355,6 @@ function handleUpdate(row) {
const postId = row.id || ids.value; const postId = row.id || ids.value;
getCartype(postId).then(response => { getCartype(postId).then(response => {
let params = response.data let params = response.data
params.state === 1 ? params.state = true : params.state = false
let TireRow = params.title?.split('T')[1]?.split('|').filter(e => e !== '') || [] let TireRow = params.title?.split('T')[1]?.split('|').filter(e => e !== '') || []
let title = [] let title = []
TireRow.forEach((res) => { TireRow.forEach((res) => {
@ -373,7 +372,6 @@ function submitForm() {
let title = (2 * TireRowInfo.value.reduce((a, b) => a + b)) + 'T' + TireRowInfo.value.map((e, index) => { let title = (2 * TireRowInfo.value.reduce((a, b) => a + b)) + 'T' + TireRowInfo.value.map((e, index) => {
return `${index + 1}-${e}|` return `${index + 1}-${e}|`
}).join('') }).join('')
form.value.state ? form.value.state = 1 : form.value.state = 0
let params = {...form.value, title} let params = {...form.value, title}
proxy.$refs["postRef"].validate(valid => { proxy.$refs["postRef"].validate(valid => {
if (valid) { if (valid) {

Loading…
Cancel
Save