Commit 0ddbc235 by wangzhihui

优化

1 parent b101470e
......@@ -55,7 +55,7 @@
margin-bottom: 20px;
}
::v-deep .el-form-item__content {
width: calc(100% - 150px);
width: calc(100% - 175px);
word-break: break-all;
line-height: 20px;
}
......
......@@ -14,7 +14,7 @@
<el-form
:ref="item.childRef"
class="edit-sub-block"
label-width="150px"
label-width="175px"
:inline="true"
:model="detailInfo"
:rules="rules"
......@@ -164,7 +164,7 @@
<el-form
:ref="item.childRef"
class="edit-sub-block"
label-width="150px"
label-width="175px"
:inline="true"
:model="detailInfo"
:rules="rules"
......@@ -173,11 +173,36 @@
<template
v-for="(customItem, customIndex) in detailInfo[item.key]"
>
<el-col :span="12" :key="customIndex">
<el-col
:span="customItem[item.type] ? 24 : 12"
:key="customIndex"
>
<el-form-item
:label="customItem[item.fieldLabel] + ':'"
>
<template>
<template v-if="customItem[item.type]">
<div
class="photo-box"
v-if="customItem[item.fieldValue]"
>
<glsx-preview
:key="customIndex"
:image-url-arr="
customItem[item.fieldValue]
? customItem[item.fieldValue]
: []
"
:picOptions="{
...picOptions,
type: customItem[item.otherType]
}"
limit="1"
></glsx-preview>
</div>
<template v-else> - </template>
</template>
<template v-else>
<div class="flex">
{{
customItem[item.fieldValue]
......@@ -203,7 +228,7 @@
>
<el-form
class="edit-sub-block"
label-width="150px"
label-width="175px"
:inline="true"
>
<el-row :gutter="20">
......@@ -285,10 +310,14 @@ import {
electronicContractTypeOpt,
oaFlowPaymentStatusOpt
} from "@/common/constants.js"
import preview from "../../../components/preview"
import { getContractDetail, getContractEdit } from "@/api/usedCarManagement.js"
import { deepClone } from "@/common/util"
import reportTrackPageMixin from "@/mixins/reportTrackPageMixin"
export default {
components: {
glsxPreview: preview
},
mixins: [reportTrackPageMixin],
data() {
return {
......@@ -436,6 +465,7 @@ export default {
key: "fieldItems",
fieldLabel: "label",
fieldValue: "value",
type: "otherType",
sign: 2,
subTitle: "签署人信息",
subData: [
......@@ -539,10 +569,61 @@ export default {
? res.carBase.carSeriesName + " " + res.carBase.carTypeName
: ""
}
this.detailInfo.fieldItems.forEach((item) => {
// let arr = [
// "机动车登记本",
// "机动车行驶证",
// "购置税完税收据",
// "购车发票",
// "交管12123截图",
// "车钥匙",
// "交强险",
// "保险单商业保险单或卡",
// "过户授权委托书照片或视频",
// "其他"
// ]
// if (arr.includes(item.label)) {
// item.otherType = "image"
if (this.getFileType(item.value) == "image") {
item.otherType = "image"
item.value = item.value.split(",")
} else if (this.getFileType(item.value) == "video") {
item.otherType = "video"
item.value = item.value.split(",")
}
// item.value = item.value.split(",")
// }
})
this.loading = false
console.log(this.detailInfo, "this.detailInfo")
})
},
getFileType(url) {
// 图片扩展名
const imageExtensions = [
"jpg",
"jpeg",
"png",
"gif",
"bmp",
"webp",
"svg"
]
// 视频扩展名
const videoExtensions = ["mp4", "avi", "mov", "wmv", "flv", "webm", "mkv"]
// 提取文件扩展名
const extension = url.split(".").pop().toLowerCase().split("?")[0]
if (imageExtensions.includes(extension)) {
return "image"
} else if (videoExtensions.includes(extension)) {
return "video"
} else {
return "unknown"
}
},
handleCancel() {
this.$router.push("/operateManagement")
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!