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;
// 车辆ID
carId?: number;
// 车牌号
carNo?: string;
// 操作员
realName?: string;
// 事故类型
accidentType?: string;
// 部门
parentOrganization?: string;
// 保险图片
image?: string;
// 排序(数字越小越靠前)

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

@ -19,19 +19,11 @@
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 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
label="保险图片"
@ -44,43 +36,24 @@
@del="onDeleteItem"
/>
</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 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 label="状态, 0正常, 1冻结" name="status">
<a-form-item label="状态" name="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-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>
</ele-modal>
</template>
@ -129,18 +102,17 @@
id: undefined,
userId: undefined,
carId: undefined,
carNo: undefined,
realName: undefined,
accidentType: undefined,
parentOrganization: undefined,
image: undefined,
sortNumber: undefined,
comments: undefined,
status: undefined,
deleted: undefined,
tenantId: undefined,
createTime: undefined,
updateTime: undefined,
hjmBxLogId: undefined,
hjmBxLogName: '',
status: 0,
comments: '',
sortNumber: 100
});
@ -202,7 +174,8 @@
message.error(e.message);
});
})
.catch(() => {});
.catch(() => {
});
};
watch(
@ -213,11 +186,14 @@
if (props.data) {
assignObject(form, props.data);
if (props.data.image) {
const arr = JSON.parse(props.data.image);
arr.map((item) => {
images.value.push({
uid: uuid(),
url: props.data.image,
url: item.url,
status: 'done'
})
});
});
}
isUpdate.value = true;
} else {

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

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

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

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

Loading…
Cancel
Save