Browse Source

修复:车辆二维码的bug

dev
科技小王子 2 months ago
parent
commit
8a08ce1b40
  1. 8
      src/api/hjm/hjmBxLog/model/index.ts
  2. 80
      src/views/hjm/hjmBxLog/components/hjmBxLogEdit.vue
  3. 42
      src/views/hjm/hjmBxLog/index.vue
  4. 4
      src/views/hjm/hjmCar/index.vue

8
src/api/hjm/hjmBxLog/model/index.ts

@ -10,6 +10,14 @@ export interface HjmBxLog {
userId?: number; userId?: number;
// 车辆ID // 车辆ID
carId?: number; carId?: number;
// 车牌号
carNo?: string;
// 操作员
realName?: string;
// 事故类型
accidentType?: string;
// 部门
parentOrganization?: string;
// 保险图片 // 保险图片
image?: string; image?: string;
// 排序(数字越小越靠前) // 排序(数字越小越靠前)

80
src/views/hjm/hjmBxLog/components/hjmBxLogEdit.vue

@ -19,19 +19,11 @@
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' } styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
" "
> >
<a-form-item label="用户ID" name="userId">
<a-input
allow-clear
placeholder="请输入用户ID"
v-model:value="form.userId"
/>
<a-form-item label="车辆编号" name="carNo">
{{ form.carNo }}
</a-form-item> </a-form-item>
<a-form-item label="车辆ID" name="carId">
<a-input
allow-clear
placeholder="请输入车辆ID"
v-model:value="form.carId"
/>
<a-form-item label="事故类型" name="accidentType">
{{ form.accidentType }}
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="保险图片" label="保险图片"
@ -44,43 +36,24 @@
@del="onDeleteItem" @del="onDeleteItem"
/> />
</a-form-item> </a-form-item>
<a-form-item label="排序(数字越小越靠前)" name="sortNumber">
<a-input-number
:min="0"
:max="9999"
class="ele-fluid"
placeholder="请输入排序号"
v-model:value="form.sortNumber"
/>
<a-form-item label="事故描述" name="comments">
{{ form.comments }}
<!-- <a-textarea-->
<!-- :rows="4"-->
<!-- :maxlength="200"-->
<!-- placeholder="请输入描述"-->
<!-- v-model:value="form.comments"-->
<!-- />-->
</a-form-item> </a-form-item>
<a-form-item label="备注" name="comments">
<a-textarea
:rows="4"
:maxlength="200"
placeholder="请输入描述"
v-model:value="form.comments"
/>
<a-form-item label="操作员" name="realName">
{{ form.realName }}
</a-form-item> </a-form-item>
<a-form-item label="状态, 0正常, 1冻结" name="status">
<a-form-item label="状态" name="status">
<a-radio-group v-model:value="form.status"> <a-radio-group v-model:value="form.status">
<a-radio :value="0">显示</a-radio>
<a-radio :value="1">隐藏</a-radio>
<a-radio :value="0">待处理</a-radio>
<a-radio :value="1">已处理</a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
<a-form-item label="是否删除, 0否, 1是" name="deleted">
<a-input
allow-clear
placeholder="请输入是否删除, 0否, 1是"
v-model:value="form.deleted"
/>
</a-form-item>
<a-form-item label="修改时间" name="updateTime">
<a-input
allow-clear
placeholder="请输入修改时间"
v-model:value="form.updateTime"
/>
</a-form-item>
</a-form> </a-form>
</ele-modal> </ele-modal>
</template> </template>
@ -129,18 +102,17 @@
id: undefined, id: undefined,
userId: undefined, userId: undefined,
carId: undefined, carId: undefined,
carNo: undefined,
realName: undefined,
accidentType: undefined,
parentOrganization: undefined,
image: undefined, image: undefined,
sortNumber: undefined,
comments: undefined, comments: undefined,
status: undefined, status: undefined,
deleted: undefined, deleted: undefined,
tenantId: undefined, tenantId: undefined,
createTime: undefined, createTime: undefined,
updateTime: undefined, updateTime: undefined,
hjmBxLogId: undefined,
hjmBxLogName: '',
status: 0,
comments: '',
sortNumber: 100 sortNumber: 100
}); });
@ -202,7 +174,8 @@
message.error(e.message); message.error(e.message);
}); });
}) })
.catch(() => {});
.catch(() => {
});
}; };
watch( watch(
@ -213,11 +186,14 @@
if (props.data) { if (props.data) {
assignObject(form, props.data); assignObject(form, props.data);
if (props.data.image) { if (props.data.image) {
const arr = JSON.parse(props.data.image);
arr.map((item) => {
images.value.push({ images.value.push({
uid: uuid(), uid: uuid(),
url: props.data.image,
url: item.url,
status: 'done' status: 'done'
})
});
});
} }
isUpdate.value = true; isUpdate.value = true;
} else { } else {

42
src/views/hjm/hjmBxLog/index.vue

@ -21,14 +21,15 @@
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'"> <template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
<template v-if="record.image" v-for="(item,index) in JSON.parse(record.image)" :key="index">
<a-image :src="item.url" :width="50"/>
</template>
</template> </template>
<template v-if="column.key === 'status'"> <template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">处理</a-tag>
<a-tag v-if="record.status === 1" color="red">处理</a-tag>
<a-tag v-if="record.status === 0" color="red">处理</a-tag>
<a-tag v-if="record.status === 1" color="green">处理</a-tag>
</template> </template>
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a> <a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/> <a-divider type="vertical"/>
<a-popconfirm <a-popconfirm
@ -37,7 +38,6 @@
> >
<a class="ele-text-danger">删除</a> <a class="ele-text-danger">删除</a>
</a-popconfirm> </a-popconfirm>
</a-space>
</template> </template>
</template> </template>
</ele-pro-table> </ele-pro-table>
@ -110,51 +110,53 @@ const columns = ref<ColumnItem[]>([
dataIndex: 'carNo', dataIndex: 'carNo',
key: 'carNo', key: 'carNo',
align: 'center', align: 'center',
width: 120
}, },
{ {
title: '事故类型', title: '事故类型',
dataIndex: 'accidentType', dataIndex: 'accidentType',
key: 'accidentType', key: 'accidentType',
align: 'center', align: 'center',
width: 170
},
{
title: '事故描述',
dataIndex: 'comments',
key: 'comments'
width: 120
}, },
{ {
title: '报险图片',
title: '现场图片',
dataIndex: 'image', dataIndex: 'image',
key: 'image', key: 'image',
align: 'center',
width: 170
align: 'center'
},
{
title: '事故描述',
dataIndex: 'comments',
key: 'comments',
align: 'center'
}, },
{ {
title: '操作员', title: '操作员',
dataIndex: 'realName', dataIndex: 'realName',
key: 'realName', key: 'realName',
align: 'center', align: 'center',
width: 170
width: 120
}, },
{ {
title: '状态', title: '状态',
dataIndex: 'status', dataIndex: 'status',
key: 'status', key: 'status',
align: 'center', align: 'center',
width: 170
width: 120
}, },
{ {
title: '创建时间', title: '创建时间',
dataIndex: 'createTime', dataIndex: 'createTime',
key: 'createTime', key: 'createTime',
align: 'center', align: 'center',
sorter: true
sorter: true,
width: 180
}, },
{ {
title: '操作', title: '操作',
key: 'action', key: 'action',
width: 180,
width: 120,
fixed: 'right', fixed: 'right',
align: 'center', align: 'center',
hideInSetting: true hideInSetting: true
@ -181,7 +183,7 @@ const openMove = () => {
/* 删除单个 */ /* 删除单个 */
const remove = (row: HjmBxLog) => { const remove = (row: HjmBxLog) => {
const hide = message.loading('请求中..', 0); const hide = message.loading('请求中..', 0);
removeHjmBxLog(row.hjmBxLogId)
removeHjmBxLog(row.id)
.then((msg) => { .then((msg) => {
hide(); hide();
message.success(msg); message.success(msg);
@ -206,7 +208,7 @@ const removeBatch = () => {
maskClosable: true, maskClosable: true,
onOk: () => { onOk: () => {
const hide = message.loading('请求中..', 0); const hide = message.loading('请求中..', 0);
removeBatchHjmBxLog(selection.value.map((d) => d.hjmBxLogId))
removeBatchHjmBxLog(selection.value.map((d) => d.id))
.then((msg) => { .then((msg) => {
hide(); hide();
message.success(msg); message.success(msg);

4
src/views/hjm/hjmCar/index.vue

@ -102,7 +102,7 @@ const showMove = ref(false);
// //
const loading = ref(true); const loading = ref(true);
// //
const qrcode = ref<number>();
const qrcode = ref<string>('');
// //
const showQrcode = ref(false); const showQrcode = ref(false);
@ -244,7 +244,7 @@ const openMove = () => {
}; };
const onShare = (row?: HjmCar) => { const onShare = (row?: HjmCar) => {
qrcode.value = row?.id;
qrcode.value = row?.code;
showQrcode.value = true; showQrcode.value = true;
} }

Loading…
Cancel
Save