Commit 78804e14 by 李伟康

```

feat(usedCarManagement): 更新车辆状态变更接口名称并优化详情页展示逻辑

- 将 `getCarManagementList` 接口重命名为 `editCarStatus` 以准确反映其功能
- 优化车辆管理详情页展示逻辑,支持动态渲染表单和操作日志
- 调整图片和文件字段的处理方式,增强数据解析与展示兼容性
- 增加车辆管理导出功能,支持通过 Vuex 管理下载任务列表
- 移除冗余示例数据,改为从接口动态获取详情信息
- 修复部分字段格式化逻辑,提升数据显示准确性
```
1 parent 056d9e76
...@@ -57,7 +57,7 @@ export const getCarManagementDetail = (data) => { ...@@ -57,7 +57,7 @@ export const getCarManagementDetail = (data) => {
/** /**
* 车辆状态变更 * 车辆状态变更
*/ */
export const getCarManagementList = (data) => { export const editCarStatus = (data) => {
return http("/carManagement/edit", "post", data) return http("/carManagement/edit", "post", data)
} }
......
<template> <template>
<div class="detail-layout"> <div class="detail-layout">
<template v-if="detailInfo">
<div :class="['layout',{'is-edit':isEdit}]"> <div :class="['layout',{'is-edit':isEdit}]">
<template v-for="(i, index) in formList"> <template v-for="(i, index) in formList">
<div <div
...@@ -34,7 +35,7 @@ ...@@ -34,7 +35,7 @@
</div> </div>
<el-image <el-image
class="img" class="img"
:src="img" :src="img[item.imgKey]"
fit="contain" fit="contain"
:preview-src-list="detailInfo[item.key]" :preview-src-list="detailInfo[item.key]"
lazy lazy
...@@ -44,6 +45,7 @@ ...@@ -44,6 +45,7 @@
</div> </div>
</template> </template>
<template v-else-if="item.type == 'file'"> <template v-else-if="item.type == 'file'">
<template v-if="detailInfo[item.name]">
<div class="file-block"> <div class="file-block">
<div class="file-name">{{detailInfo[item.name]}}</div> <div class="file-name">{{detailInfo[item.name]}}</div>
<div <div
...@@ -52,6 +54,7 @@ ...@@ -52,6 +54,7 @@
>查看</div> >查看</div>
</div> </div>
</template> </template>
</template>
<template v-else> <template v-else>
<template v-if="isEdit"> <template v-if="isEdit">
<template v-if="item.type == 'input'"> <template v-if="item.type == 'input'">
...@@ -111,11 +114,11 @@ ...@@ -111,11 +114,11 @@
<template v-if="item.formatter"> <template v-if="item.formatter">
<div <div
class="formatter" class="formatter"
v-html="item.formatter(detailInfo[item.key])" v-html="item.formatter(detailInfo)"
></div> ></div>
</template> </template>
<template v-else> <template v-else>
{{ detailInfo[item.key]}}发过来光棍节 {{ detailInfo[item.key]}}
</template> </template>
</template> </template>
</template> </template>
...@@ -141,6 +144,7 @@ ...@@ -141,6 +144,7 @@
</div> </div>
</template> </template>
</div> </div>
</template>
<div class="footer-box"> <div class="footer-box">
<el-button <el-button
type="primary" type="primary"
...@@ -179,6 +183,17 @@ export const rangePickerOptions = { ...@@ -179,6 +183,17 @@ export const rangePickerOptions = {
return false return false
} }
} }
import {
getCarManagementDetail,
getCarManagementLog,
editCarStatus
} from "@api/usedCarManagement"
import {
OWNER_TYPE,
USAGE_TYPE,
HAS_ACCIDENT
} from './contant'
export default { export default {
components: { components: {
DetailBlock DetailBlock
...@@ -187,14 +202,7 @@ export default { ...@@ -187,14 +202,7 @@ export default {
name: '', name: '',
data () { data () {
return { return {
detailInfo: { detailInfo: null,
carImg: [
'https://ts1.tc.mm.bing.net/th/id/OIP-C.mH9YLFEL5YdVxJM82mjVJQHaEo?w=274&h=211&c=8&rs=1&qlt=70&o=7&cb=thws5&pid=3.1&rm=3',
'https://ts1.tc.mm.bing.net/th/id/OIP-C.i792mzm7Ju77m23lHCOFHQHaFj?w=262&h=211&c=8&rs=1&qlt=70&o=7&cb=thws5&pid=3.1&rm=3'
],
filename1: '苟利国家生死岂因祸福避趋之',
file1: 'https://dj-oss-fastdfs-release.oss-cn-shenzhen.aliyuncs.com/%E5%B1%95%E4%B8%9A%E5%8A%A9%E6%89%8B-%E5%9C%BA%E6%99%AF%E9%9B%86%E5%B8%82%E5%9F%8B%E7%82%B9%E6%95%B0%E6%8D%AE.xlsx'
},
id: '', id: '',
isEdit: false, isEdit: false,
formList: [ formList: [
...@@ -204,35 +212,43 @@ export default { ...@@ -204,35 +212,43 @@ export default {
{ {
label: '车辆状态', label: '车辆状态',
required: true, required: true,
key: 'carStatus', formatter: cellValue => {
formatter: (val) => { return CAR_STATUS[cellValue.carStatus] || '-'
return CAR_STATUS[val]
}, },
type: 'select', type: 'select',
options: CAR_STATUS_OPTIONS options: CAR_STATUS_OPTIONS
}, },
{ {
label: '车辆创建人', label: '车辆创建人',
key: 'carCreator'
}, },
{ {
label: '保管地', label: '保管地',
key: 'storageLocation',
type: 'input', type: 'input',
maxLength: 50 maxLength: 50
}, },
{ {
label: '保管人', label: '保管人',
key: 'custodian'
}, },
{ {
label: '代保管合同', label: '代保管合同',
type: 'file', type: 'file',
name: 'filename1', name: 'custodyContract',
key: 'file1' key: 'custodyContract'
}, },
{ {
label: '交车确认书', label: '交车确认书',
key: 'deliveryConfirmation',
type: 'file',
name: 'deliveryConfirmation'
}, },
{ {
label: '补充协议', label: '补充协议',
key: 'supplementaryAgreement',
type: 'file',
name: 'supplementaryAgreement'
} }
] ]
}, },
...@@ -241,33 +257,39 @@ export default { ...@@ -241,33 +257,39 @@ export default {
data: [ data: [
{ {
label: '收车价', label: '收车价',
key: 'purchasePrice'
}, },
{ {
label: '收车时间', label: '收车时间',
key: 'purchaseTime'
}, },
{ {
label: '卖出价', label: '卖出价',
type: 'input', type: 'input',
maxLength: 15, maxLength: 15,
regexpFunction: decimals, regexpFunction: decimals,
suffixText: '元' suffixText: '元',
key: 'sellingPrice'
}, },
{ {
label: '卖出时间', label: '卖出时间',
type: 'date', type: 'date',
pickerOptions: rangePickerOptions pickerOptions: rangePickerOptions,
key: 'sellingTime'
}, },
{ {
label: '卖出方', label: '卖出方',
width: '100%', width: '100%',
type: 'textarea', type: 'textarea',
maxLength: 200 maxLength: 200,
key: 'seller'
}, },
{ {
label: '车辆卖出备注', label: '车辆卖出备注',
width: '100%', width: '100%',
type: 'textarea', type: 'textarea',
maxLength: 200 maxLength: 200,
key: 'sellingNotes'
}, },
] ]
}, },
...@@ -276,71 +298,100 @@ export default { ...@@ -276,71 +298,100 @@ export default {
data: [ data: [
{ {
label: '车牌号', label: '车牌号',
key: 'licensePlate'
}, },
{ {
label: '车架号', label: '车架号',
key: 'vin'
}, },
{ {
label: '车型', label: '车型',
key: 'carTypeName'
}, },
{ {
label: '上牌城市', label: '上牌城市',
key: 'listingCity'
}, },
{ {
label: '表显里程', label: '表显里程',
key: 'mileage'
}, },
{ {
label: '使用性质', label: '使用性质',
formatter: cellValue => {
return USAGE_TYPE[cellValue?.usageType] || '-'
}
}, },
{ {
label: '所有人性质', label: '所有人性质',
formatter: cellValue => {
return OWNER_TYPE[cellValue?.ownerType] || '-'
}
}, },
{ {
label: '天窗', label: '天窗',
key: 'sunroof'
}, },
{ {
label: '是否事故', label: '是否事故',
formatter: cellValue => {
return HAS_ACCIDENT[cellValue?.hasAccident] || '-'
}
}, },
{ {
label: '车辆来源门店', label: '车辆来源门店',
key: 'sourceStore'
}, },
{ {
label: '车辆创建时间', label: '车辆创建时间',
key: 'createTime'
}, },
{ {
label: '原车主姓名', label: '原车主姓名',
key: 'originalOwner'
}, },
{ {
label: '原车主联系方式', label: '原车主联系方式',
key: 'ownerContact'
}, },
{ {
label: '交强险到期日', label: '交强险到期日',
key: 'insuranceExpiry'
}, },
{ {
label: '年审到期日', label: '年审到期日',
key: 'inspectionExpiry'
}, },
{ {
label: '新车指导价', label: '新车指导价',
key: 'msrp'
}, },
{ {
label: '车辆生产日期', label: '车辆生产日期',
key: 'productionDate'
}, },
{ {
label: '车辆图片', label: '车辆图片',
type: 'imgList', type: 'imgList',
width: '100%', width: '100%',
key: 'carImg' key: 'carImages',
imgKey: 'fileUrl'
}, },
{ {
label: '证件资料', label: '证件资料',
type: 'imgList', type: 'imgList',
width: '100%' width: '100%',
key: 'documents',
imgKey: 'fileUrl'
}, },
{ {
label: '车辆备注', label: '车辆备注',
width: '100%', width: '100%',
type: 'textarea', type: 'textarea',
maxLength: 200 maxLength: 200,
key: 'vehicleNotes'
}, },
] ]
}, },
...@@ -349,12 +400,15 @@ export default { ...@@ -349,12 +400,15 @@ export default {
data: [ data: [
{ {
label: '钥匙编码', label: '钥匙编码',
key: 'keyCode'
}, },
{ {
label: '钥匙数', label: '钥匙数',
key: 'keyCount'
}, },
{ {
label: '过户次数', label: '过户次数',
key: 'transfersNumber'
}, },
] ]
}, },
...@@ -385,11 +439,31 @@ export default { ...@@ -385,11 +439,31 @@ export default {
const { id, isEdit } = this.$route.query const { id, isEdit } = this.$route.query
if (id) this.id = id if (id) this.id = id
this.isEdit = isEdit this.isEdit = isEdit
this.getCarManagementDetail()
this.getCarManagementLog()
}, },
methods: { methods: {
labelType (type) { labelType (type) {
return type == 'textarea' return type == 'textarea'
}, },
async getCarManagementDetail () {
const data = await getCarManagementDetail({ id: this.id })
console.log(data)
if (data.carImages) {
data.carImages = JSON.parse(data.carImages)
console.log(data.carImages)
} else data.carImages = []
if (data.documents) {
data.documents = JSON.parse(data.documents)
} else data.documents = []
this.detailInfo = data
},
async getCarManagementLog(){
const data = await getCarManagementLog({
id: this.id
})
console.log(data,'--------')
},
openFile (key) { openFile (key) {
window.open(this.detailInfo[key]) window.open(this.detailInfo[key])
}, },
......
...@@ -39,7 +39,9 @@ ...@@ -39,7 +39,9 @@
</d2-table-header> </d2-table-header>
<d2-table <d2-table
ref="vehicleManagementTable" ref="vehicleManagementTable"
:search-form="searchFormSearch" :search-form="{
t:searchFormSearch
}"
:table-params="tableParams" :table-params="tableParams"
:get-list-api="getListApi" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn" :before-search-fn="beforeSearchFn"
...@@ -94,9 +96,9 @@ ...@@ -94,9 +96,9 @@
<script> <script>
import { deepClone } from "@/common/util" import { deepClone } from "@/common/util"
import { import {
exportCarManagementPage,
getCarManagementPage, getCarManagementPage,
} from "@api/usedCarManagement" } from "@api/usedCarManagement"
import { mapActions, mapState } from "vuex"
import { import {
CAR_STATUS_OPTIONS, CAR_STATUS_OPTIONS,
CAR_STATUS, CAR_STATUS,
...@@ -311,8 +313,8 @@ export default { ...@@ -311,8 +313,8 @@ export default {
label: "是否事故", label: "是否事故",
prop: "hasAccident", prop: "hasAccident",
minWidth: 120, minWidth: 120,
formatter: (row) => { formatter: cellValue => {
return HAS_ACCIDENT[row.hasAccident] || '-' return HAS_ACCIDENT[cellValue.hasAccident] || '-'
} }
}, },
{ {
...@@ -350,11 +352,21 @@ export default { ...@@ -350,11 +352,21 @@ export default {
}, },
} }
}, },
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
mounted () { mounted () {
this.getOptionsList() this.getOptionsList()
}, },
methods: { methods: {
...mapActions({
get: "d2admin/base/get",
close: "d2admin/page/close"
}),
...mapActions("d2admin/user", ["actionSetDownloadList"]),
handleReset () { handleReset () {
this.searchForm = this.$options.data.call(this).searchForm this.searchForm = this.$options.data.call(this).searchForm
this.$refs.vehicleManagementTable.refreshTable(true, true) this.$refs.vehicleManagementTable.refreshTable(true, true)
...@@ -397,9 +409,7 @@ export default { ...@@ -397,9 +409,7 @@ export default {
} }
delete params.registerTime delete params.registerTime
delete params.carCreateTime delete params.carCreateTime
return { return params
t: params,
}
}, },
handleDetail (row) { handleDetail (row) {
this.$router.push({ this.$router.push({
...@@ -419,8 +429,24 @@ export default { ...@@ -419,8 +429,24 @@ export default {
}) })
}, },
handleExport () { handleExport () {
console.log('导出') let params = {
// exportCarManagementPage method: '/carManagement/export',
server_provider_type: 'gsc',
server_provider_name: 'gsc-vcp-web-facade',
...this.getParams()
}
const list = [
...this.dowloadList,
{
name: "车辆管理",
exportParam: JSON.stringify(params),
status: "waiting",
timeid: new Date().getTime()
}
]
console.log(list)
this.actionSetDownloadList({ list, type: 'dowloadList' })
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!