Commit c2f0d3f6 authored by wangjiancheng's avatar wangjiancheng

feat:新增品牌名称下拉框

parent 30cda148
...@@ -47,10 +47,14 @@ export function delLogic(id) { ...@@ -47,10 +47,14 @@ export function delLogic(id) {
} }
// 升版 // 升版
export function upgradeBaseInternational(id) { export function upgradeBaseInternational(formData,id) {
return request({ return request({
url: '/control/baseInternationalKeyComponentsList/upGrade/' + id, url: '/control/baseInternationalKeyComponentsList/upGrade/' + id,
method: 'post' method: 'post',
data: formData,
headers: {
'Content-Type': 'multipart/form-data'
}
}) })
} }
// 生成清单版本号、清单号 // 生成清单版本号、清单号
...@@ -76,3 +80,10 @@ export function getBaseInternationalDepartment() { ...@@ -76,3 +80,10 @@ export function getBaseInternationalDepartment() {
method: 'get' method: 'get'
}) })
} }
// 获取品牌名称
export function getBrandName() {
return request({
url: '/control/brandData/allList?type=国际',
method: 'get',
})
}
...@@ -42,3 +42,12 @@ export function delDetail(componentsListId) { ...@@ -42,3 +42,12 @@ export function delDetail(componentsListId) {
method: 'delete' method: 'delete'
}) })
} }
// 校对生产厂
export function checkProductionFactory(componentListId) {
return request({
url: '/control/baseInternationalKeyComponentsDetail/checkProductionFactory' + componentListId,
method: 'get'
})
}
...@@ -58,11 +58,14 @@ ...@@ -58,11 +58,14 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="品牌" prop="brand"> <el-form-item label="品牌" prop="brand">
<el-input <el-select v-model="queryParams.brand" placeholder="请选择" clearable size="default" style="width: 193px">
v-model="queryParams.brand" <el-option
placeholder="请输入品牌" v-for="item in brandOptions"
@keyup.enter="handleQuery" :key="item.value"
:label="item.label"
:value="item.value"
/> />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="数据状态" prop="dataStatus"> <el-form-item label="数据状态" prop="dataStatus">
<el-select v-model="queryParams.dataStatus" placeholder="请选择" clearable size="default" style="width: 193px"> <el-select v-model="queryParams.dataStatus" placeholder="请选择" clearable size="default" style="width: 193px">
...@@ -105,25 +108,25 @@ ...@@ -105,25 +108,25 @@
<!-- 列表 --> <!-- 列表 -->
<el-table v-loading="loading" :data="baseInternationalList"> <el-table v-loading="loading" :data="baseInternationalList">
<el-table-column label="序号" type="index" width="75" align="center"/> <el-table-column label="序号" type="index" width="75" align="center"/>
<el-table-column label="事业部" align="center" prop="division" width="100" sortable/> <el-table-column label="事业部" align="center" prop="division" width="90" sortable/>
<el-table-column label="适用市场" align="center" prop="applicableMarket" width="100" sortable> <el-table-column label="适用市场" align="center" prop="applicableMarket" width="200" sortable>
<template #default="scope"> <template #default="scope">
{{ isNotEmpty(scope.row.applicableMarket) }} {{ isNotEmpty(scope.row.applicableMarket) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="车型代码" align="center" prop="modelCode" width="100" sortable/> <el-table-column label="车型代码" align="center" prop="modelCode" width="100" sortable/>
<el-table-column label="动力类型" align="center" prop="powerType" width="100" sortable/> <el-table-column label="动力类型" align="center" prop="powerType" width="100" sortable/>
<el-table-column label="发动机型号" align="center" prop="engineModel" width="126" sortable> <el-table-column label="发动机型号" align="center" prop="engineModel" width="190" sortable>
<template #default="scope"> <template #default="scope">
{{ isNotEmpty(scope.row.engineModel) }} {{ isNotEmpty(scope.row.engineModel) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="动力电池型号" align="center" prop="powerBatteryModel" width="126" sortable> <el-table-column label="动力电池型号" align="center" prop="powerBatteryModel" width="190" sortable>
<template #default="scope"> <template #default="scope">
{{ isNotEmpty(scope.row.powerBatteryModel) }} {{ isNotEmpty(scope.row.powerBatteryModel) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="变速器型号" align="center" prop="transmissionModel" width="150" sortable> <el-table-column label="变速器型号" align="center" prop="transmissionModel" width="190" sortable>
<template #default="scope"> <template #default="scope">
{{ isNotEmpty(scope.row.transmissionModel) }} {{ isNotEmpty(scope.row.transmissionModel) }}
</template> </template>
...@@ -134,13 +137,13 @@ ...@@ -134,13 +137,13 @@
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') || '--' }}</span> <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') || '--' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="品牌" align="center" prop="brand" width="120" sortable> <el-table-column label="品牌" align="center" prop="brand" width="220" sortable>
<template #default="scope"> <template #default="scope">
{{ isNotEmpty(scope.row.brand) }} {{ getBrandLabelsByIds(scope.row.brand) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="数据状态" align="center" prop="dataStatus" width="150" sortable/> <el-table-column label="数据状态" align="center" prop="dataStatus" width="100" sortable/>
<el-table-column label="清单编号" align="center" prop="listCode" width="100" sortable/> <el-table-column label="清单编号" align="center" prop="listCode" width="160" sortable/>
<el-table-column label="操作" align="center" fixed="right" width="260px"> <el-table-column label="操作" align="center" fixed="right" width="260px">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click="handleUpdate(scope.row)" v-if="scope.row.dataStatus === '未生效'"> <el-button link type="primary" @click="handleUpdate(scope.row)" v-if="scope.row.dataStatus === '未生效'">
...@@ -153,7 +156,8 @@ ...@@ -153,7 +156,8 @@
<el-button link type="primary" @click="handleUpload(scope.row)" v-if="scope.row.dataStatus === '未生效'"> <el-button link type="primary" @click="handleUpload(scope.row)" v-if="scope.row.dataStatus === '未生效'">
上传文件 上传文件
</el-button> </el-button>
<el-button link type="danger" @click="handleUndo(scope.row)" v-if="scope.row.dataStatus === '未生效'">删除 <el-button link type="danger" @click="handleUndo(scope.row)" v-if="scope.row.dataStatus === '未生效'">
删除
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -490,7 +494,7 @@ ...@@ -490,7 +494,7 @@
{{ form.division }} {{ form.division }}
</el-form-item> </el-form-item>
<el-form-item label="品牌"> <el-form-item label="品牌">
{{ isNotEmpty(form.brand) }} {{ getBrandLabelsByIds(form.brand) }}
</el-form-item> </el-form-item>
<el-form-item label="车型代码"> <el-form-item label="车型代码">
{{ form.modelCode }} {{ form.modelCode }}
...@@ -524,11 +528,10 @@ ...@@ -524,11 +528,10 @@
v-model="undoDialogVisible" v-model="undoDialogVisible"
title="" title=""
align-center align-center
style="width: 400px;height: 195px;margin-top: 300px" :fullscreen="true" style="width: 400px;height: 195px;margin-top: 300px"
> >
<template #header> <template #header>
<div>提示</div> <div>提示/Prompt</div>
<div>Prompt</div>
</template> </template>
<div style="display: flex;align-items: center;"> <div style="display: flex;align-items: center;">
<el-icon style="color: orange;font-size: 18px;margin:5px"> <el-icon style="color: orange;font-size: 18px;margin:5px">
...@@ -557,7 +560,7 @@ import { ...@@ -557,7 +560,7 @@ import {
addBaseInternational, addBaseInternational,
updateBaseInternational, updateBaseInternational,
getBaseInternationalNo, getBaseInternationalNo,
getBaseInternationalDepartment getBaseInternationalDepartment, upgradeBaseInternational,getBrandName
} from "@/api/BaseInternationalKeyComponents/BaseInternationalKeyComponents.js"; } from "@/api/BaseInternationalKeyComponents/BaseInternationalKeyComponents.js";
import {getMarket} from "@/api/BaseIntlPartTemplate/BaseIntlPartTemplateDetail.js"; import {getMarket} from "@/api/BaseIntlPartTemplate/BaseIntlPartTemplateDetail.js";
import {getAllUnit} from "@/api/BaseIntlPartTemplate/BaseIntlPartTemplate.js"; import {getAllUnit} from "@/api/BaseIntlPartTemplate/BaseIntlPartTemplate.js";
...@@ -677,21 +680,15 @@ function getApplicableMarket() { ...@@ -677,21 +680,15 @@ function getApplicableMarket() {
} }
}) })
}) })
// 品牌 todo // 品牌
brandOptions.value = [ getBrandName().then(response => {
{ brandOptions.value = response.data.map(item => {
value: '品牌1', return {
label: '品牌1' value: item.id,
}, label: item.brand
{ }
value: '品牌2', })
label: '品牌2' })
},
{
value: '品牌3',
label: '品牌3'
},
]
// 车型代码 todo // 车型代码 todo
modelCodeOptions.value = [ modelCodeOptions.value = [
{ {
...@@ -772,6 +769,14 @@ function getApplicableMarket() { ...@@ -772,6 +769,14 @@ function getApplicableMarket() {
} }
] ]
} }
// 根据品牌id获取品牌名称
const getBrandLabelsByIds = (brandIds) => {
if (!Array.isArray(brandIds)) return '--';
const labels = brandOptions.value
.filter(item => brandIds.includes(item.value))
.map(item => item.label);
return labels.length ? labels.join('、') : '--';
}
// 查看数据 // 查看数据
function handleView(row) { function handleView(row) {
...@@ -961,7 +966,7 @@ function submitForm() { ...@@ -961,7 +966,7 @@ function submitForm() {
formData.append('baseInternationalKeyComponentsList', JSON.stringify(form.value)); formData.append('baseInternationalKeyComponentsList', JSON.stringify(form.value));
formData.append('file', fileNew.value); formData.append('file', fileNew.value);
addBaseInternational(formData).then(response => { addBaseInternational(formData).then(response => {
if (response.msg != null) { if (response.code === 200) {
proxy.$modal.msgSuccess("新增成功"); proxy.$modal.msgSuccess("新增成功");
openAdd.value = false; openAdd.value = false;
fileNew.value = null; fileNew.value = null;
...@@ -975,7 +980,7 @@ function submitForm() { ...@@ -975,7 +980,7 @@ function submitForm() {
// 升版--提交按钮 // 升版--提交按钮
function submitUpgradeForm(id) { function submitUpgradeForm(id) {
proxy.$refs["baseInternationalRef"].validate(valid => {
const formData = new FormData(); const formData = new FormData();
if (fileNew.value) { if (fileNew.value) {
formData.append('file', fileNew.value); formData.append('file', fileNew.value);
...@@ -983,13 +988,7 @@ function submitUpgradeForm(id) { ...@@ -983,13 +988,7 @@ function submitUpgradeForm(id) {
proxy.$modal.msgError("请上传文件"); proxy.$modal.msgError("请上传文件");
return; return;
} }
request('/control/baseInternationalKeyComponentsList/upGrade/' + id, { upgradeBaseInternational(formData, id).then(response => {
method: 'post',
data: formData,
headers: {
'Content-Type': 'multipart/form-data'
}
}).then(response => {
if (response.code === 200){ if (response.code === 200){
proxy.$modal.msgSuccess("升版成功"); proxy.$modal.msgSuccess("升版成功");
openUpgrade.value = false; openUpgrade.value = false;
...@@ -997,12 +996,10 @@ function submitUpgradeForm(id) { ...@@ -997,12 +996,10 @@ function submitUpgradeForm(id) {
getList(); getList();
} }
}) })
});
} }
// 上传文件--提交按钮 // 上传文件--提交按钮
function submitUploadForm() { function submitUploadForm() {
proxy.$refs["baseInternationalRef"].validate(valid => {
const formData = new FormData(); const formData = new FormData();
if (fileNew.value) { if (fileNew.value) {
formData.append('file', fileNew.value); formData.append('file', fileNew.value);
...@@ -1025,7 +1022,6 @@ function submitUploadForm() { ...@@ -1025,7 +1022,6 @@ function submitUploadForm() {
getList(); getList();
} }
}) })
});
} }
const delId = ref(null) const delId = ref(null)
......
...@@ -296,9 +296,10 @@ ...@@ -296,9 +296,10 @@
import { import {
listDetail, listDetail,
updateDetail, updateDetail,
getDetail getDetail, checkProductionFactory
} from "@/api/BaseInternationalKeyComponents/BaseInternationalKeyComponentsDetail.js"; } from "@/api/BaseInternationalKeyComponents/BaseInternationalKeyComponentsDetail.js";
import {getBaseInternational, updateBaseInternationalStatus} from "@/api/BaseInternationalKeyComponents/BaseInternationalKeyComponents.js"; import {getBaseInternational, updateBaseInternationalStatus} from "@/api/BaseInternationalKeyComponents/BaseInternationalKeyComponents.js";
import request from '@/utils/request'
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const { p8_post_production_unit } = proxy.useDict('p8_post_production_unit'); const { p8_post_production_unit } = proxy.useDict('p8_post_production_unit');
...@@ -435,10 +436,12 @@ function handleUpdateDataStatus(componentsListId) { ...@@ -435,10 +436,12 @@ function handleUpdateDataStatus(componentsListId) {
getList(); getList();
}); });
} }
// 校对生产厂 todo 进入页面自动加载 // 校对生产厂 todo
function handleVerify() { function handleVerify() {
// 根据componentsListId checkProductionFactory(componentsListId).then(response => {
proxy.$modal.msgSuccess("校对完成");
getList();
})
} }
// 填写校对备注 todo // 填写校对备注 todo
function handleVerifyRemark(row) { function handleVerifyRemark(row) {
...@@ -477,11 +480,10 @@ function submitForm() { ...@@ -477,11 +480,10 @@ function submitForm() {
// 上传文件--提交按钮 // 上传文件--提交按钮
function submitUploadForm() { function submitUploadForm() {
proxy.$refs["baseInternationalRef"].validate(valid => {
const formData = new FormData(); const formData = new FormData();
if (fileNew.value) { if (fileNew.value) {
formData.append('file', fileNew.value); formData.append('file', fileNew.value);
}else { } else {
proxy.$modal.msgError("请上传文件"); proxy.$modal.msgError("请上传文件");
return; return;
} }
...@@ -492,14 +494,13 @@ function submitUploadForm() { ...@@ -492,14 +494,13 @@ function submitUploadForm() {
'Content-Type': 'multipart/form-data' 'Content-Type': 'multipart/form-data'
} }
}).then(response => { }).then(response => {
if (response.code === 200){ if (response.code === 200) {
proxy.$modal.msgSuccess(response.msg); proxy.$modal.msgSuccess(response.msg);
fileNew.value = null fileNew.value = null
openUpload.value = false; openUpload.value = false;
getList(); getList();
} }
}) })
})
} }
// 上传文件 // 上传文件
function handleUpload() { function handleUpload() {
...@@ -517,6 +518,7 @@ function onBack() { ...@@ -517,6 +518,7 @@ function onBack() {
proxy.$router.push({ path: '/baseData/criticalPartsList/BaseInternationalKeyComponents'}); proxy.$router.push({ path: '/baseData/criticalPartsList/BaseInternationalKeyComponents'});
} }
getList(); getList();
handleVerify();
</script> </script>
<style scoped> <style scoped>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment