Commit 846b2a34 authored by Mr.Tang's avatar Mr.Tang

国内国际中英文对照 表格样式修改

parent 55b449d5
...@@ -49,3 +49,10 @@ export function treeListModel(query) { ...@@ -49,3 +49,10 @@ export function treeListModel(query) {
params: query, params: query,
}) })
} }
export function treeListInternationalModel(query) {
return request({
url: '/control/model/treeListInternationalModel',
method: 'get',
params: query,
})
}
{
"serialNumber": "序号",
"vehicleModelAnnouncementNumberCumulativeProductionThisYear": "车型公告号今年累计产量",
"modelCodeCumulativeProductionThisYear": "车型代码今年累计产量",
"brand": "品牌",
"modelAnnouncementNumber": "车型公告号",
"vehicleModelCode": "车型代码",
"quickNodeSearch": "节点快速查找",
"modelSeries": "车型系列",
"powerType": "动力类型",
"isMaintained": "是否维护",
"businessUnit": "事业部",
"engineModel": "发动机型号",
"certifiedDeclarationOfProductionAddress": "认证申报生产地址",
"manufactureFactory": "制造工厂",
"createTime": "创建时间",
"updateTime": "修改时间",
"operation":"操作",
"add": "新增",
"handleUpdate": "编辑",
"handleDelete": "删除",
"submitForm": "确定",
"cancel": "取消",
"handleQuery": "搜索按钮操作",
"resetQuery": "重置按钮操作",
"modifySuccess": "修改成功",
"addSuccess": "新增成功",
"deleteSuccess": "删除成功",
"confirmDelete": "是否确认删除该数据项?",
"pleaseEnter": "请输入",
"pleaseChoose": "请选择",
"search": "查询",
"reset": "重置",
"export": "导出"
}
\ No newline at end of file
{
"serialNumber": "Serial Number",
"vehicleModelAnnouncementNumberCumulativeProductionThisYear": "Vehicle model announcement number: Cumulative production this year",
"modelCodeCumulativeProductionThisYear": "Model code: Cumulative production this year",
"brand": "brand",
"modelAnnouncementNumber": "Model Announcement Number",
"vehicleModelCode": "Vehicle Model Code",
"quickNodeSearch": "Quick Node Search",
"modelSeries": "Model Series",
"powerType": "Power Type",
"isMaintained": "Is Maintained",
"businessUnit": "Business Unit",
"engineModel": "Engine Model",
"certifiedDeclarationOfProductionAddress": "Certified Declaration Of Production Address",
"manufactureFactory": "Manufacture Factory",
"createTime": "Create Time",
"updateTime": "Update Time",
"operation":"operation",
"add": "add",
"handleUpdate": "Edit",
"handleDelete": "Delete",
"submitForm": "Confirm",
"cancel": "Cancel",
"handleQuery": "Search Button Operation",
"resetQuery": "Reset Button Operation",
"modifySuccess": "Modification Successful",
"addSuccess": "Addition Successful",
"deleteSuccess": "Deletion Successful",
"confirmDelete": "Are you sure you want to delete this data item?",
"pleaseEnter": "PleaseEnter",
"pleaseChoose": "PleaseChoose",
"search": "Search",
"reset": "Reset",
"export": "Export"
}
\ No newline at end of file
{
"serialNumber": "序号",
"accumulatedProductionThisYear": "今年累计产量",
"singleCertificate": "单项证书",
"vehicleCertificate": "整车认证证书",
"applicableMarket": "适用市场",
"transmissionModel": "变速器型号",
"powerBatteryModel": "动力电池型号",
"vehicleModelAnnouncementNumberCumulativeProductionThisYear": "车型公告号今年累计产量",
"modelCodeCumulativeProductionThisYear": "车型代码今年累计产量",
"brand": "品牌",
"modelAnnouncementNumber": "车型公告号",
"vehicleModelCode": "车型代码",
"quickNodeSearch": "节点快速查找",
"modelSeries": "车型系列",
"powerType": "动力类型",
"isMaintained": "是否维护",
"businessUnit": "事业部",
"engineModel": "发动机型号",
"certifiedDeclarationOfProductionAddress": "认证申报生产地址",
"manufactureFactory": "制造工厂",
"createTime": "创建时间",
"updateTime": "修改时间",
"operation":"操作",
"add": "新增",
"handleUpdate": "编辑",
"handleDelete": "删除",
"submitForm": "确定",
"cancel": "取消",
"handleQuery": "搜索按钮操作",
"resetQuery": "重置按钮操作",
"modifySuccess": "修改成功",
"addSuccess": "新增成功",
"deleteSuccess": "删除成功",
"confirmDelete": "是否确认删除该数据项?",
"pleaseEnter": "请输入",
"pleaseChoose": "请选择",
"search": "查询",
"reset": "重置",
"export": "导出"
}
\ No newline at end of file
{
"serialNumber": "Serial Number",
"accumulatedProductionThisYear": "Accumulated production this year",
"singleCertificate": "single Certificate",
"vehicleCertificate": "vehicle Certificate",
"applicableMarket": "Applicable Market",
"transmissionModel": "Transmission Model",
"powerBatteryModel": "Power Battery Model",
"vehicleModelAnnouncementNumberCumulativeProductionThisYear": "Vehicle model announcement number: Cumulative production this year",
"modelCodeCumulativeProductionThisYear": "Model code: Cumulative production this year",
"brand": "brand",
"modelAnnouncementNumber": "Model Announcement Number",
"vehicleModelCode": "Vehicle Model Code",
"quickNodeSearch": "Quick Node Search",
"modelSeries": "Model Series",
"powerType": "Power Type",
"isMaintained": "Is Maintained",
"businessUnit": "Business Unit",
"engineModel": "Engine Model",
"certifiedDeclarationOfProductionAddress": "Certified Declaration Of Production Address",
"manufactureFactory": "Manufacture Factory",
"createTime": "Create Time",
"updateTime": "Update Time",
"operation":"operation",
"add": "add",
"handleUpdate": "Edit",
"handleDelete": "Delete",
"submitForm": "Confirm",
"cancel": "Cancel",
"handleQuery": "Search Button Operation",
"resetQuery": "Reset Button Operation",
"modifySuccess": "Modification Successful",
"addSuccess": "Addition Successful",
"deleteSuccess": "Deletion Successful",
"confirmDelete": "Are you sure you want to delete this data item?",
"pleaseEnter": "PleaseEnter",
"pleaseChoose": "PleaseChoose",
"search": "Search",
"reset": "Reset",
"export": "Export"
}
\ No newline at end of file
{
"standardNumber": "标准编号",
"standardName": "标准名称",
"partName": "零件名称",
"notice": "共5个未关联法规的CQC关键零部件",
"serialNumber": "序号",
"correspondingParts": "对应零件",
"createTime": "创建时间",
"updateTime": "修改时间",
"operation":"操作",
"add": "新增",
"handleUpdate": "编辑",
"handleDelete": "删除",
"submitForm": "确定",
"cancel": "取消",
"handleQuery": "搜索按钮操作",
"resetQuery": "重置按钮操作",
"modifySuccess": "修改成功",
"addSuccess": "新增成功",
"deleteSuccess": "删除成功",
"confirmDelete": "是否确认删除该数据项?",
"pleaseEnter": "请输入",
"pleaseChoose": "请选择",
"search": "查询",
"reset": "重置"
}
\ No newline at end of file
{
"standardNumber": "Standard Number",
"standardName": "Standard Name",
"partName": "Part Name",
"notice": "A total of 5 CQC key components not related to regulations",
"serialNumber": "Serial Number",
"correspondingParts": "Corresponding Parts",
"order": "order",
"createTime": "Create Time",
"updateTime": "Update Time",
"operation":"operation",
"add": "add",
"handleUpdate": "Edit",
"handleDelete": "Delete",
"submitForm": "Confirm",
"cancel": "Cancel",
"handleQuery": "Search Button Operation",
"resetQuery": "Reset Button Operation",
"modifySuccess": "Modification Successful",
"addSuccess": "Addition Successful",
"deleteSuccess": "Deletion Successful",
"confirmDelete": "Are you sure you want to delete this data item?",
"pleaseEnter": "PleaseEnter",
"pleaseChoose": "PleaseChoose",
"search": "Search",
"reset": "Reset"
}
\ No newline at end of file
{
"standardNumber": "标准编号",
"standardName": "标准名称",
"partName": "零件名称",
"notice": "共5个未关联法规的CQC关键零部件",
"serialNumber": "序号",
"correspondingParts": "对应零件",
"applicableMarket": "适用市场",
"createTime": "创建时间",
"updateTime": "修改时间",
"operation":"操作",
"add": "新增",
"handleUpdate": "编辑",
"handleDelete": "删除",
"submitForm": "确定",
"cancel": "取消",
"handleQuery": "搜索按钮操作",
"resetQuery": "重置按钮操作",
"modifySuccess": "修改成功",
"addSuccess": "新增成功",
"deleteSuccess": "删除成功",
"confirmDelete": "是否确认删除该数据项?",
"pleaseEnter": "请输入",
"pleaseChoose": "请选择",
"search": "查询",
"reset": "重置",
"responsibleDepartmentForTheGuaranteePlan": "保证计划书责任部门"
}
{
"standardNumber": "Standard Number",
"standardName": "Standard Name",
"partName": "Part Name",
"notice": "A total of 5 CQC key components not related to regulations",
"serialNumber": "Serial Number",
"correspondingParts": "Corresponding Parts",
"applicableMarket": "Applicable Market",
"order": "order",
"createTime": "Create Time",
"updateTime": "Update Time",
"operation":"operation",
"add": "add",
"handleUpdate": "Edit",
"handleDelete": "Delete",
"submitForm": "Confirm",
"cancel": "Cancel",
"handleQuery": "Search Button Operation",
"resetQuery": "Reset Button Operation",
"modifySuccess": "Modification Successful",
"addSuccess": "Addition Successful",
"deleteSuccess": "Deletion Successful",
"confirmDelete": "Are you sure you want to delete this data item?",
"pleaseEnter": "PleaseEnter",
"pleaseChoose": "PleaseChoose",
"search": "Search",
"reset": "Reset",
"responsibleDepartmentForTheGuaranteePlan": "Responsible department for the guarantee plan"
}
\ No newline at end of file
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
<div class="tree-header"> <div class="tree-header">
<el-input <el-input
v-model="quickSearchText" v-model="quickSearchText"
placeholder="请输入节点" :placeholder="`${cn.quickNodeSearch}/${en.quickNodeSearch}`"
clearable clearable
prefix-icon="el-icon-search" @input="handleSearchInput"
/> />
</div> </div>
<div class="tree-content"> <div class="tree-content">
...@@ -35,15 +35,17 @@ ...@@ -35,15 +35,17 @@
ref="queryRef" ref="queryRef"
:model="queryParams" :model="queryParams"
:inline="true" :inline="true"
label-width="130px"
border border
> >
<el-form-item label="车型系列" prop="modelSeries"> <el-form-item
:label="`${cn.modelSeries}/${en.modelSeries}`"
prop="modelSeries"
>
<el-select <el-select
v-model="queryParams.modelSeries" v-model="queryParams.modelSeries"
placeholder="请选择" :placeholder="`${cn.pleaseChoose}/${en.pleaseChoose}`"
clearable clearable
style="width: 100px" style="width: 200px"
> >
<el-option <el-option
v-for="item in modelSeriesOptions" v-for="item in modelSeriesOptions"
...@@ -53,12 +55,15 @@ ...@@ -53,12 +55,15 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="动力类型" prop="powerType"> <el-form-item
:label="`${cn.powerType}/${en.powerType}`"
prop="powerType"
>
<el-select <el-select
v-model="queryParams.powerType" v-model="queryParams.powerType"
placeholder="请选择" :placeholder="`${cn.pleaseChoose}/${en.pleaseChoose}`"
clearable clearable
style="width: 100px" style="width: 200px"
> >
<el-option <el-option
v-for="dict in power_type" v-for="dict in power_type"
...@@ -68,12 +73,15 @@ ...@@ -68,12 +73,15 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="是否维护" prop="isMaintained"> <el-form-item
:label="`${cn.isMaintained}/${en.isMaintained}`"
prop="isMaintained"
>
<el-select <el-select
v-model="queryParams.isMaintained" v-model="queryParams.isMaintained"
placeholder="请选择" :placeholder="`${cn.pleaseChoose}/${en.pleaseChoose}`"
clearable clearable
style="width: 100px" style="width: 200px"
> >
<el-option <el-option
v-for="item in vehicle_model_maintenance" v-for="item in vehicle_model_maintenance"
...@@ -83,12 +91,15 @@ ...@@ -83,12 +91,15 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="事业部" prop="businessUnitId"> <el-form-item
:label="`${cn.businessUnit}/${en.businessUnit}`"
prop="businessUnitId"
>
<el-select <el-select
v-model="queryParams.businessUnitId" v-model="queryParams.businessUnitId"
placeholder="请选择" :placeholder="`${cn.pleaseChoose}/${en.pleaseChoose}`"
clearable clearable
style="width: 100px" style="width: 200px"
> >
<el-option <el-option
v-for="item in businessUnitOptions" v-for="item in businessUnitOptions"
...@@ -99,30 +110,39 @@ ...@@ -99,30 +110,39 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="发动机型号" prop="engineModel"> <el-form-item
:label="`${cn.engineModel}/${en.engineModel}`"
prop="engineModel"
>
<el-input <el-input
v-model="queryParams.engineModel" v-model="queryParams.engineModel"
placeholder="请输入" :placeholder="`${cn.pleaseEnter}/${en.pleaseEnter}`"
clearable clearable
style="width: 100px" style="width: 200px"
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="认证申报生产地址" prop="productionAddress"> <el-form-item
:label="`${cn.certifiedDeclarationOfProductionAddress}/${en.certifiedDeclarationOfProductionAddress}`"
prop="productionAddress"
>
<el-input <el-input
v-model="queryParams.productionAddress" v-model="queryParams.productionAddress"
placeholder="请输入" :placeholder="`${cn.pleaseEnter}/${en.pleaseEnter}`"
clearable clearable
style="width: 100px" style="width: 200px"
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="制造工厂" prop="manufacturingPlant"> <el-form-item
:label="`${cn.manufactureFactory}/${en.manufactureFactory}`"
prop="manufacturingPlant"
>
<el-select <el-select
v-model="queryParams.manufacturingPlant" v-model="queryParams.manufacturingPlant"
placeholder="请选择" :placeholder="`${cn.pleaseChoose}/${en.pleaseChoose}`"
clearable clearable
style="width: 100px" style="width: 200px"
> >
<el-option <el-option
v-for="item in factoryOptions" v-for="item in factoryOptions"
...@@ -135,27 +155,27 @@ ...@@ -135,27 +155,27 @@
<el-form-item label="CVN" prop="cvn"> <el-form-item label="CVN" prop="cvn">
<el-input <el-input
v-model="queryParams.cvn" v-model="queryParams.cvn"
placeholder="请输入" :placeholder="`${cn.pleaseEnter}/${en.pleaseEnter}`"
clearable clearable
style="width: 100px" style="width: 200px"
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="CALID" prop="calid"> <el-form-item label="CALID" prop="calid">
<el-input <el-input
v-model="queryParams.calid" v-model="queryParams.calid"
placeholder="请输入" :placeholder="`${cn.pleaseEnter}/${en.pleaseEnter}`"
clearable clearable
style="width: 100px" style="width: 200px"
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button class="btn-A" icon="Search" @click="handleQuery" <el-button style="width: 110px" class="btn-A" @click="handleQuery"
>搜索</el-button >{{ cn.search }}/{{ en.search }}</el-button
> >
<el-button class="btn-B" icon="Refresh" @click="resetQuery" <el-button style="width: 110px" class="btn-B" @click="resetQuery"
>重置</el-button >{{ cn.reset }}/{{ en.reset }}</el-button
> >
<div> <div>
<el-button <el-button
...@@ -166,7 +186,7 @@ ...@@ -166,7 +186,7 @@
color: #0154fb; color: #0154fb;
" "
@click="handleExport" @click="handleExport"
>导出</el-button >{{ cn.export }}/{{ en.export }}</el-button
> >
</div> </div>
</el-form-item> </el-form-item>
...@@ -191,7 +211,13 @@ ...@@ -191,7 +211,13 @@
/> />
<!-- 序号列(固定) --> <!-- 序号列(固定) -->
<el-table-column label="序号" align="center" width="80" fixed="left"> <el-table-column label="序号" align="center" width="120" fixed="left">
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.serialNumber }}</div>
<div>{{ en.serialNumber }}</div>
</div>
</template>
<template #default="scope"> <template #default="scope">
{{ scope.$index + 1 }} {{ scope.$index + 1 }}
</template> </template>
...@@ -202,17 +228,86 @@ ...@@ -202,17 +228,86 @@
label="事业部" label="事业部"
align="center" align="center"
prop="businessUnitName" prop="businessUnitName"
/> width="120"
<el-table-column label="车型代码" align="center" prop="modelCode" /> >
<el-table-column label="车型系列" align="center" prop="modelSeries" /> <template #header>
<el-table-column label="动力类型" align="center" prop="powerType" /> <div style="display: flex; flex-direction: column">
<div>{{ cn.businessUnit }}</div>
<div>{{ en.businessUnit }}</div>
</div>
</template>
</el-table-column>
<el-table-column
label="车型代码"
align="center"
prop="modelCode"
min-width="150"
>
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.vehicleModelCode }}</div>
<div>{{ en.vehicleModelCode }}</div>
</div>
</template>
</el-table-column>
<el-table-column
label="车型系列"
align="center"
prop="modelSeries"
width="120"
><template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.modelSeries }}</div>
<div>{{ en.modelSeries }}</div>
</div>
</template></el-table-column
>
<el-table-column
label="动力类型"
align="center"
width="120"
prop="powerType"
>
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.powerType }}</div>
<div>{{ en.powerType }}</div>
</div>
</template>
</el-table-column>
<el-table-column <el-table-column
label="车型公告号" label="车型公告号"
align="center" align="center"
width="220"
prop="modelAnnouncementNumber" prop="modelAnnouncementNumber"
/> >
<el-table-column label="品牌" align="center" prop="brand" /> <template #header>
<el-table-column label="是否维护" align="center" prop="isMaintained"> <div style="display: flex; flex-direction: column">
<div>{{ cn.modelAnnouncementNumber }}</div>
<div>{{ en.modelAnnouncementNumber }}</div>
</div>
</template>
</el-table-column>
<el-table-column label="品牌" align="center" width="100" prop="brand">
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.brand }}</div>
<div>{{ en.brand }}</div>
</div>
</template>
</el-table-column>
<el-table-column
label="是否维护"
align="center"
width="120"
prop="isMaintained"
>
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.isMaintained }}</div>
<div>{{ en.isMaintained }}</div>
</div>
</template>
<template #default="scope"> <template #default="scope">
<dict-tag <dict-tag
:options="vehicle_model_maintenance" :options="vehicle_model_maintenance"
...@@ -223,34 +318,92 @@ ...@@ -223,34 +318,92 @@
<el-table-column <el-table-column
label="发动机型号" label="发动机型号"
align="center" align="center"
width="120"
prop="engineModel" prop="engineModel"
/> >
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.engineModel }}</div>
<div>{{ en.engineModel }}</div>
</div>
</template>
</el-table-column>
<el-table-column <el-table-column
label="车型代码今年累计产量" label="车型代码今年累计产量"
align="center" align="center"
width="200"
prop="modelCodeYearlyProduction" prop="modelCodeYearlyProduction"
/> >
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.modelCodeCumulativeProductionThisYear }}</div>
<div>{{ en.modelCodeCumulativeProductionThisYear }}</div>
</div>
</template>
</el-table-column>
<el-table-column <el-table-column
label="车型公告号今年累计产量" label="车型公告号今年累计产量"
align="center" align="center"
width="320"
prop="announcementYearlyProduction" prop="announcementYearlyProduction"
/> >
<template #header>
<div style="display: flex; flex-direction: column">
<div>
{{
cn.vehicleModelAnnouncementNumberCumulativeProductionThisYear
}}
</div>
<div>
{{
en.vehicleModelAnnouncementNumberCumulativeProductionThisYear
}}
</div>
</div>
</template>
</el-table-column>
<el-table-column label="CVN" align="center" prop="cvn" width="120" /> <el-table-column label="CVN" align="center" prop="cvn" width="120" />
<el-table-column label="CALID" align="center" prop="calid" /> <el-table-column label="CALID" align="center" prop="calid" />
<el-table-column <el-table-column
label="认证申报生产地址" label="认证申报生产地址"
align="center" align="center"
width="320"
prop="productionAddress" prop="productionAddress"
/> >
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.certifiedDeclarationOfProductionAddress }}</div>
<div>{{ en.certifiedDeclarationOfProductionAddress }}</div>
</div>
</template>
</el-table-column>
<el-table-column <el-table-column
label="制造工厂" label="制造工厂"
align="center" align="center"
prop="manufacturingPlant" prop="manufacturingPlant"
width="150" width="200"
/> >
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.manufactureFactory }}</div>
<div>{{ en.manufactureFactory }}</div>
</div>
</template>
</el-table-column>
<!-- 固定右侧的操作列 --> <!-- 固定右侧的操作列 -->
<el-table-column label="操作" align="center" fixed="right"> <el-table-column
label="操作"
align="center"
fixed="right"
min-width="150"
>
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.operation }}</div>
<div>{{ en.operation }}</div>
</div>
</template>
<template #default="scope"> <template #default="scope">
<el-button <el-button
link link
...@@ -355,6 +508,8 @@ import { getAllFactoryName } from '@/api/system/factory' ...@@ -355,6 +508,8 @@ import { getAllFactoryName } from '@/api/system/factory'
import { getAllBusinessUnitName } from '@/api/system/basicdata/businessunit' import { getAllBusinessUnitName } from '@/api/system/basicdata/businessunit'
import { getAllModelSeries } from '@/api/filingParameter/library.js' import { getAllModelSeries } from '@/api/filingParameter/library.js'
import { computed, ref, toRefs, watch } from 'vue' import { computed, ref, toRefs, watch } from 'vue'
import cn from '@/locales/baseData/vehicleModelData/domesticModel/cn.json'
import en from '@/locales/baseData/vehicleModelData/domesticModel/en.json'
import { updateManufacturers } from '@/api/system/basicdata/manufacturer.js' import { updateManufacturers } from '@/api/system/basicdata/manufacturer.js'
const appStore = useAppStore() const appStore = useAppStore()
...@@ -446,19 +601,48 @@ const treeProps = { ...@@ -446,19 +601,48 @@ const treeProps = {
children: 'children', children: 'children',
} }
// 处理搜索输入
const handleSearchInput = () => {
deptTreeRef.value.filter(quickSearchText.value.toLowerCase())
}
/** 通过条件过滤节点 */ /** 通过条件过滤节点 */
const filterNode = (value, data) => { const filterNode = (value, data) => {
if (!value) return true if (!value) return true
return data.label.indexOf(value) !== -1 const searchValue = value.toLowerCase()
// 检查节点标签
if (data.label && data.label.toLowerCase().includes(searchValue)) {
return true
}
// 检查原始数据字段
if (data.originalData) {
return Object.values(data.originalData).some((val) => {
if (typeof val === 'string') {
return val.toLowerCase().includes(searchValue)
}
return false
})
}
return false
} }
/** 根据名称筛选部门树 */
/*watch(modelCode, (val) => {
proxy.$refs['deptTreeRef'].filter(val)
})*/
/** 节点单击事件 */ /** 节点单击事件 */
function handleNodeClick(data) { function handleNodeClick(data) {
queryParams.value.deptId = data.id console.log('data', data)
if (data.label === '全部') {
queryParams.value.modelCode = ''
queryParams.value.modelAnnouncementNumber = ''
} else {
if (data.children) {
queryParams.value.modelCode = data.label
} else {
queryParams.value.modelAnnouncementNumber = data.label
}
}
handleQuery() handleQuery()
} }
// Vue 中的 v-model 绑定默认是字符串类型。 // Vue 中的 v-model 绑定默认是字符串类型。
...@@ -471,6 +655,7 @@ const businessUnitOptions = ref([]) // 获取所有事业部列表 ...@@ -471,6 +655,7 @@ const businessUnitOptions = ref([]) // 获取所有事业部列表
const quickSearchText = ref('') const quickSearchText = ref('')
// 原始数据副本 // 原始数据副本
const originalModelList = ref([]) const originalModelList = ref([])
const deptTreeRef = ref(null)
const factoryOptions = ref([]) const factoryOptions = ref([])
const modelSeriesOptions = ref([]) const modelSeriesOptions = ref([])
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
<div class="tree-header"> <div class="tree-header">
<el-input <el-input
v-model="quickSearchText" v-model="quickSearchText"
placeholder="请输入节点" :placeholder="`${cn.quickNodeSearch}/${en.quickNodeSearch}`"
clearable clearable
prefix-icon="el-icon-search" @input="handleSearchInput"
/> />
</div> </div>
<div class="tree-content"> <div class="tree-content">
...@@ -35,14 +35,16 @@ ...@@ -35,14 +35,16 @@
ref="queryRef" ref="queryRef"
:model="queryParams" :model="queryParams"
:inline="true" :inline="true"
label-width="96px"
> >
<el-form-item label="动力类型" prop="powerType"> <el-form-item
:label="`${cn.powerType}/${en.powerType}`"
prop="powerType"
>
<el-select <el-select
v-model="queryParams.powerType" v-model="queryParams.powerType"
placeholder="请选择" placeholder="请选择"
clearable clearable
style="width: 100px" style="width: 200px"
> >
<el-option <el-option
v-for="dict in power_type" v-for="dict in power_type"
...@@ -52,48 +54,63 @@ ...@@ -52,48 +54,63 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="发动机型号" prop="engineModel"> <el-form-item
:label="`${cn.engineModel}/${en.engineModel}`"
prop="engineModel"
>
<el-input <el-input
v-model="queryParams.engineModel" v-model="queryParams.engineModel"
placeholder="请输入" placeholder="请输入"
clearable clearable
style="width: 100px" style="width: 200px"
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="动力电池型号" prop="powerBatteryModel"> <el-form-item
:label="`${cn.powerBatteryModel}/${en.powerBatteryModel}`"
prop="powerBatteryModel"
>
<el-input <el-input
v-model="queryParams.powerBatteryModel" v-model="queryParams.powerBatteryModel"
placeholder="请输入" placeholder="请输入"
clearable clearable
style="width: 100px" style="width: 200px"
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="变速器型号" prop="transmissionModel"> <el-form-item
:label="`${cn.transmissionModel}/${en.transmissionModel}`"
prop="transmissionModel"
>
<el-input <el-input
v-model="queryParams.transmissionModel" v-model="queryParams.transmissionModel"
placeholder="请输入" placeholder="请输入"
clearable clearable
style="width: 120px" style="width: 200px"
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="适用市场" prop="applicableMarket"> <el-form-item
:label="`${cn.applicableMarket}/${en.applicableMarket}`"
prop="applicableMarket"
>
<el-input <el-input
v-model="queryParams.applicableMarket" v-model="queryParams.applicableMarket"
placeholder="请输入" placeholder="请输入"
clearable clearable
style="width: 120px" style="width: 200px"
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="事业部" prop="businessUnitId"> <el-form-item
:label="`${cn.businessUnit}/${en.businessUnit}`"
prop="businessUnitId"
>
<el-select <el-select
v-model="queryParams.businessUnitId" v-model="queryParams.businessUnitId"
placeholder="请选择" placeholder="请选择"
clearable clearable
style="width: 120px" style="width: 200px"
> >
<el-option <el-option
v-for="item in businessUnitOptions" v-for="item in businessUnitOptions"
...@@ -103,30 +120,39 @@ ...@@ -103,30 +120,39 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="整车认证证书" prop="vehicleCertificate"> <el-form-item
:label="`${cn.vehicleCertificate}/${en.vehicleCertificate}`"
prop="vehicleCertificate"
>
<el-input <el-input
v-model="queryParams.vehicleCertificate" v-model="queryParams.vehicleCertificate"
placeholder="请输入" placeholder="请输入"
clearable clearable
style="width: 100px" style="width: 200px"
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="单项证书" prop="singleCertificate"> <el-form-item
:label="`${cn.singleCertificate}/${en.singleCertificate}`"
prop="singleCertificate"
>
<el-input <el-input
v-model="queryParams.singleCertificate" v-model="queryParams.singleCertificate"
placeholder="请输入" placeholder="请输入"
clearable clearable
style="width: 100px" style="width: 200px"
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="是否维护" prop="isMaintained"> <el-form-item
:label="`${cn.isMaintained}/${en.isMaintained}`"
prop="isMaintained"
>
<el-select <el-select
v-model="queryParams.isMaintained" v-model="queryParams.isMaintained"
placeholder="请选择" placeholder="请选择"
clearable clearable
style="width: 100px" style="width: 200px"
> >
<el-option <el-option
v-for="item in vehicle_model_maintenance" v-for="item in vehicle_model_maintenance"
...@@ -138,11 +164,11 @@ ...@@ -138,11 +164,11 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button class="btn-A" icon="Search" @click="handleQuery" <el-button style="width: 110px" class="btn-A" @click="handleQuery"
>搜索</el-button >{{ cn.search }}/{{ en.search }}</el-button
> >
<el-button class="btn-B" icon="Refresh" @click="resetQuery" <el-button style="width: 110px" class="btn-B" @click="resetQuery"
>重置</el-button >{{ cn.reset }}/{{ en.reset }}</el-button
> >
<div> <div>
<el-button <el-button
...@@ -153,7 +179,7 @@ ...@@ -153,7 +179,7 @@
color: #0154fb; color: #0154fb;
" "
@click="handleExport" @click="handleExport"
>导出</el-button >{{ cn.export }}/{{ en.export }}</el-button
> >
</div> </div>
</el-form-item> </el-form-item>
...@@ -169,51 +195,160 @@ ...@@ -169,51 +195,160 @@
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" width="80"> <el-table-column label="序号" align="center" width="120">
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.serialNumber }}</div>
<div>{{ en.serialNumber }}</div>
</div>
</template>
<template #default="scope"> <template #default="scope">
{{ scope.$index + 1 }} {{ scope.$index + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="type" align="center" prop="type" /> <el-table-column
<el-table-column label="车型代码" align="center" prop="modelCode" /> label="type"
<el-table-column label="动力类型" align="center" prop="powerType" /> align="center"
width="100"
prop="type"
/>
<el-table-column
label="车型代码"
align="center"
width="150"
prop="modelCode"
>
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.vehicleModelCode }}</div>
<div>{{ en.vehicleModelCode }}</div>
</div>
</template>
</el-table-column>
<el-table-column
label="动力类型"
align="center"
width="120"
prop="powerType"
>
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.powerType }}</div>
<div>{{ en.powerType }}</div>
</div>
</template>
</el-table-column>
<el-table-column <el-table-column
label="发动机型号" label="发动机型号"
align="center" align="center"
width="120"
prop="engineModel" prop="engineModel"
/> >
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.engineModel }}</div>
<div>{{ en.engineModel }}</div>
</div>
</template>
</el-table-column>
<el-table-column <el-table-column
label="动力电池型号" label="动力电池型号"
align="center" align="center"
width="180"
prop="powerBatteryModel" prop="powerBatteryModel"
/> >
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.powerBatteryModel }}</div>
<div>{{ en.powerBatteryModel }}</div>
</div>
</template>
</el-table-column>
<el-table-column <el-table-column
label="变速器型号" label="变速器型号"
align="center" align="center"
width="180"
prop="transmissionModel" prop="transmissionModel"
/> >
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.transmissionModel }}</div>
<div>{{ en.transmissionModel }}</div>
</div>
</template>
</el-table-column>
<el-table-column <el-table-column
label="适用市场" label="适用市场"
align="center" align="center"
width="150"
prop="applicableMarket" prop="applicableMarket"
/> >
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.applicableMarket }}</div>
<div>{{ en.applicableMarket }}</div>
</div>
</template>
</el-table-column>
<el-table-column <el-table-column
label="事业部" label="事业部"
align="center" align="center"
width="120"
prop="businessUnitName" prop="businessUnitName"
/> >
<el-table-column label="品牌" align="center" prop="brand" /> <template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.businessUnit }}</div>
<div>{{ en.businessUnit }}</div>
</div>
</template>
</el-table-column>
<el-table-column label="品牌" align="center" width="100" prop="brand">
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.brand }}</div>
<div>{{ en.brand }}</div>
</div>
</template>
</el-table-column>
<el-table-column <el-table-column
label="整车认证证书" label="整车认证证书"
align="center" align="center"
width="150"
prop="vehicleCertificate" prop="vehicleCertificate"
/> >
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.vehicleCertificate }}</div>
<div>{{ en.vehicleCertificate }}</div>
</div>
</template>
</el-table-column>
<el-table-column <el-table-column
label="单项证书" label="单项证书"
align="center" align="center"
width="150"
prop="singleCertificate" prop="singleCertificate"
/> >
<el-table-column label="是否维护" align="center" prop="isMaintained"> <template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.singleCertificate }}</div>
<div>{{ en.singleCertificate }}</div>
</div>
</template>
</el-table-column>
<el-table-column
label="是否维护"
align="center"
width="120"
prop="isMaintained"
>
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.isMaintained }}</div>
<div>{{ en.isMaintained }}</div>
</div>
</template>
<template #default="scope"> <template #default="scope">
<dict-tag <dict-tag
:options="vehicle_model_maintenance" :options="vehicle_model_maintenance"
...@@ -225,18 +360,41 @@ ...@@ -225,18 +360,41 @@
<el-table-column <el-table-column
label="今年累计产量" label="今年累计产量"
align="center" align="center"
width="250"
prop="yearlyProduction" prop="yearlyProduction"
/> >
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.accumulatedProductionThisYear }}</div>
<div>{{ en.accumulatedProductionThisYear }}</div>
</div>
</template>
</el-table-column>
<el-table-column <el-table-column
label="制造工厂" label="制造工厂"
align="center" align="center"
width="200"
prop="manufacturingPlant" prop="manufacturingPlant"
/> >
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.manufactureFactory }}</div>
<div>{{ en.manufactureFactory }}</div>
</div>
</template>
</el-table-column>
<el-table-column <el-table-column
label="操作" label="操作"
align="center" align="center"
class-name="small-padding fixed-width" fixed="right"
min-width="150"
> >
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.operation }}</div>
<div>{{ en.operation }}</div>
</div>
</template>
<template #default="scope"> <template #default="scope">
<el-button <el-button
v-hasPermi="['control:model:edit']" v-hasPermi="['control:model:edit']"
...@@ -331,10 +489,12 @@ import { ...@@ -331,10 +489,12 @@ import {
updateModel, updateModel,
listModel, listModel,
getModel, getModel,
treeListModel, treeListInternationalModel,
} from '@/api/vehicleModelData/domestic' } from '@/api/vehicleModelData/domestic'
import { getAllFactoryName } from '@/api/system/factory' import { getAllFactoryName } from '@/api/system/factory'
import { getAllBusinessUnitName } from '@/api/system/basicdata/businessunit' import { getAllBusinessUnitName } from '@/api/system/basicdata/businessunit'
import cn from '@/locales/baseData/vehicleModelData/internationalModel/cn.json'
import en from '@/locales/baseData/vehicleModelData/internationalModel/en.json'
import { computed, ref, toRefs, watch } from 'vue' import { computed, ref, toRefs, watch } from 'vue'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const { vehicle_model_maintenance, power_type } = proxy.useDict( const { vehicle_model_maintenance, power_type } = proxy.useDict(
...@@ -383,6 +543,7 @@ const data = reactive({ ...@@ -383,6 +543,7 @@ const data = reactive({
}, },
rules: {}, rules: {},
}) })
const deptTreeRef = ref(null)
// 树形结构固定数据 // 树形结构固定数据
const deptOptions = ref([ const deptOptions = ref([
{ {
...@@ -427,14 +588,48 @@ const treeProps = { ...@@ -427,14 +588,48 @@ const treeProps = {
label: 'label', label: 'label',
children: 'children', children: 'children',
} }
// 处理搜索输入
const handleSearchInput = () => {
deptTreeRef.value.filter(quickSearchText.value.toLowerCase())
}
/** 通过条件过滤节点 */ /** 通过条件过滤节点 */
const filterNode = (value, data) => { const filterNode = (value, data) => {
if (!value) return true if (!value) return true
return data.label.indexOf(value) !== -1 const searchValue = value.toLowerCase()
// 检查节点标签
if (data.label && data.label.toLowerCase().includes(searchValue)) {
return true
}
// 检查原始数据字段
if (data.originalData) {
return Object.values(data.originalData).some((val) => {
if (typeof val === 'string') {
return val.toLowerCase().includes(searchValue)
}
return false
})
}
return false
} }
function handleNodeClick(data) { function handleNodeClick(data) {
queryParams.value.deptId = data.id console.log('data', data)
if (data.label === '全部') {
queryParams.value.type = ''
queryParams.value.modelCode = ''
queryParams.value.powerType = ''
} else {
if (data.children) {
queryParams.value.modelCode = data.label
} else {
queryParams.value.powerType = data.label
}
}
handleQuery() handleQuery()
} }
// Vue 中的 v-model 绑定默认是字符串类型。 // Vue 中的 v-model 绑定默认是字符串类型。
...@@ -493,19 +688,21 @@ function getList() { ...@@ -493,19 +688,21 @@ function getList() {
}) })
} }
/** 查询国内车型列表 */ /** 查询国际车型树状结构图 */
function getTreeList() { function getTreeList() {
loading.value = true loading.value = true
return treeListModel(queryParams.value).then((response) => { return treeListInternationalModel(queryParams.value).then((response) => {
// Transform the response data into the desired tree structure // Transform the response data into the desired tree structure
deptOptions.value[0].children = Object.entries(response).map( deptOptions.value[0].children = Object.entries(response).map(
([modelCode, items]) => ({ ([type, items]) => ({
id: modelCode, id: type,
label: modelCode, label: type,
children: items.map((item) => ({ children: items.map((item) => ({
id: item.modelAnnouncementNumber, id: item.modelCode,
label: item.modelAnnouncementNumber || '未命名公告号', label: `${item.modelCode || '未命名公告号'} ${item.powerType || ''}`,
originalData: item, // Keep reference to original data modelCode: item.modelCode, // 保留原始字段
powerType: item.powerType, // 保留原始字段
originalData: item, // 保留原始数据
})), })),
}), }),
) )
...@@ -514,7 +711,24 @@ function getTreeList() { ...@@ -514,7 +711,24 @@ function getTreeList() {
console.log('Tree data:', JSON.stringify(deptOptions.value, null, 2)) console.log('Tree data:', JSON.stringify(deptOptions.value, null, 2))
}) })
} }
// 计算属性实现快速搜索
const filteredList = computed(() => {
if (!quickSearchText.value) return originalModelList.value
const searchText = quickSearchText.value.toLowerCase()
return originalModelList.value.filter((item) => {
return (
(item.type && item.type.toLowerCase().includes(searchText)) ||
(item.modelCode && item.modelCode.toLowerCase().includes(searchText)) ||
(item.powerType && item.powerType.toLowerCase().includes(searchText))
)
})
})
// 监听 filteredList 并更新 modelList
watch(filteredList, (newVal) => {
modelList.value = newVal
})
// 取消按钮 // 取消按钮
function cancel() { function cancel() {
open.value = false open.value = false
......
<template>
<div class="app-container">
<el-form
v-show="showSearch"
ref="queryRef"
:model="queryParams"
:inline="true"
>
<el-form-item
:label="`${cn.standardNumber}/${en.standardNumber}`"
prop="standardNumberId"
>
<el-input
v-model="queryParams.standardNumberId"
:placeholder="`${cn.pleaseEnter}/${en.pleaseEnter}`"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item
:label="`${cn.standardName}/${en.standardName}`"
prop="standardNumberId"
>
<el-input
v-model="queryParams.standardNumberId"
:placeholder="`${cn.pleaseEnter}/${en.pleaseEnter}`"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item
:label="`${cn.partName}/${en.partName}`"
prop="standardNumberId"
>
<el-input
v-model="queryParams.standardNumberId"
:placeholder="`${cn.pleaseChoose}/${en.pleaseChoose}`"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button style="width: 110px" class="btn-A" @click="handleQuery"
>{{ cn.search }}/{{ en.search }}</el-button
>
<el-button style="width: 110px" class="btn-B" @click="resetQuery"
>{{ cn.reset }}/{{ en.reset }}</el-button
>
</el-form-item>
<el-form-item> 共5个未关联法规的CQC关键零部件 </el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="partList"
@selection-change="handleSelectionChange"
>
<el-table-column label="序号" align="center" width="150" fixed="left">
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.serialNumber }}</div>
<div>{{ en.serialNumber }}</div>
</div>
</template>
<template #default="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="标准编号" align="center" prop="standardNumberId">
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.standardNumber }}</div>
<div>{{ en.standardNumber }}</div>
</div>
</template>
</el-table-column>
<el-table-column label="标准名称" align="center" prop="partId">
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.standardName }}</div>
<div>{{ en.standardName }}</div>
</div>
</template>
</el-table-column>
<el-table-column label="对应零件" align="center" prop="partId">
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.correspondingParts }}</div>
<div>{{ en.correspondingParts }}</div>
</div>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
</div>
<!-- 添加或修改国际法规与关键件中间对话框 -->
<el-dialog v-model="open" :title="title" width="500px" append-to-body>
<el-form ref="partRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="备注" prop="remark">
<el-input
v-model="form.remark"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item>
<el-form-item label="${comment}" prop="delFlag">
<el-input v-model="form.delFlag" placeholder="请输入${comment}" />
</el-form-item>
<el-form-item label="零件表ID" prop="partId">
<el-input v-model="form.partId" placeholder="请输入零件表ID" />
</el-form-item>
<el-form-item label="标准编号" prop="standardNumberId">
<el-input
v-model="form.standardNumberId"
placeholder="请输入标准编号"
/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button class="btn-B" @click="submitForm"
>{{ cn.cancel }}/{{ en.cancel }}</el-button
>
<el-button class="btn-A" @click="cancel"
>{{ cn.submitForm }}/{{ en.submitForm }}</el-button
>
</div>
</template>
</el-dialog>
</template>
<script setup name="Part">
/*import {
listPart,
getPart,
delPart,
addPart,
updatePart,
} from '@/api/control/part'*/
import cn from '@/locales/controlPlan/relationshipManagement/domesticRegulationPart/cn.json'
import en from '@/locales/controlPlan/relationshipManagement/domesticRegulationPart/en.json'
const { proxy } = getCurrentInstance()
const partList = ref([])
const open = ref(false)
const loading = ref(false)
const showSearch = ref(true)
const ids = ref([])
const single = ref(true)
const multiple = ref(true)
const total = ref(0)
const title = ref('')
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
partId: null,
standardNumberId: null,
},
rules: {
createTime: [
{ required: true, message: '创建时间不能为空', trigger: 'blur' },
],
updateBy: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
updateTime: [
{ required: true, message: '更新时间不能为空', trigger: 'blur' },
],
partId: [{ required: true, message: '零件表ID不能为空', trigger: 'blur' }],
standardNumberId: [
{ required: true, message: '标准编号不能为空', trigger: 'blur' },
],
},
})
const { queryParams, form, rules } = toRefs(data)
/** 查询国际法规与关键件中间列表 */
function getList() {
loading.value = false
listPart(queryParams.value).then((response) => {
partList.value = response.rows
total.value = response.total
loading.value = false
})
}
// 取消按钮
function cancel() {
open.value = false
reset()
}
// 表单重置
function reset() {
form.value = {
id: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
delFlag: null,
partId: null,
standardNumberId: null,
}
proxy.resetForm('partRef')
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1
getList()
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm('queryRef')
handleQuery()
}
// 多选框选中数据
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.id)
single.value = selection.length != 1
multiple.value = !selection.length
}
/** 新增按钮操作 */
function handleAdd() {
reset()
open.value = true
title.value = '添加国际法规与关键件中间'
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset()
const _id = row.id || ids.value
getPart(_id).then((response) => {
form.value = response.data
open.value = true
title.value = '修改国际法规与关键件中间'
})
}
/** 提交按钮 */
function submitForm() {
proxy.$refs['partRef'].validate((valid) => {
if (valid) {
if (form.value.id != null) {
updatePart(form.value).then((response) => {
proxy.$modal.msgSuccess('修改成功')
open.value = false
getList()
})
} else {
addPart(form.value).then((response) => {
proxy.$modal.msgSuccess('新增成功')
open.value = false
getList()
})
}
}
})
}
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value
proxy.$modal
.confirm('是否确认删除国际法规与关键件中间编号为"' + _ids + '"的数据项?')
.then(function () {
return delPart(_ids)
})
.then(() => {
getList()
proxy.$modal.msgSuccess('删除成功')
})
.catch(() => {})
}
/** 导出按钮操作 */
function handleExport() {
proxy.download(
'control/part/export',
{
...queryParams.value,
},
`part_${new Date().getTime()}.xlsx`,
)
}
/*getList()*/
</script>
<template>
<div class="app-container">
<el-form
v-show="showSearch"
ref="queryRef"
:model="queryParams"
:inline="true"
>
<el-form-item
:label="`${cn.standardNumber}/${en.standardNumber}`"
prop="standardNumberId"
>
<el-input
v-model="queryParams.standardNumberId"
:placeholder="`${cn.pleaseEnter}/${en.pleaseEnter}`"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item
:label="`${cn.standardName}/${en.standardName}`"
prop="standardNumberId"
>
<el-input
v-model="queryParams.standardNumberId"
:placeholder="`${cn.pleaseEnter}/${en.pleaseEnter}`"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item
:label="`${cn.partName}/${en.partName}`"
prop="standardNumberId"
>
<el-input
v-model="queryParams.standardNumberId"
:placeholder="`${cn.pleaseChoose}/${en.pleaseChoose}`"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item
:label="`${cn.applicableMarket}/${en.applicableMarket}`"
prop="standardNumberId"
>
<el-input
v-model="queryParams.standardNumberId"
:placeholder="`${cn.applicableMarket}/${en.applicableMarket}`"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button style="width: 110px" class="btn-A" @click="handleQuery"
>{{ cn.search }}/{{ en.search }}</el-button
>
<el-button style="width: 110px" class="btn-B" @click="resetQuery"
>{{ cn.reset }}/{{ en.reset }}</el-button
>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="partList"
@selection-change="handleSelectionChange"
>
<el-table-column label="序号" align="center" width="150" fixed="left">
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.serialNumber }}</div>
<div>{{ en.serialNumber }}</div>
</div>
</template>
<template #default="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="标准编号" align="center" prop="standardNumberId">
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.standardNumber }}</div>
<div>{{ en.standardNumber }}</div>
</div>
</template>
</el-table-column>
<el-table-column label="标准名称" align="center" prop="partId">
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.standardName }}</div>
<div>{{ en.standardName }}</div>
</div>
</template>
</el-table-column>
<el-table-column label="适用市场" align="center" prop="partId">
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.applicableMarket }}</div>
<div>{{ en.applicableMarket }}</div>
</div>
</template>
</el-table-column>
<el-table-column label="对应零件" align="center" prop="partId">
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.correspondingParts }}</div>
<div>{{ en.correspondingParts }}</div>
</div>
</template>
</el-table-column>
<el-table-column label="保证计划书责任部门" align="center" prop="partId">
<template #header>
<div style="display: flex; flex-direction: column">
<div>{{ cn.responsibleDepartmentForTheGuaranteePlan }}</div>
<div>{{ en.responsibleDepartmentForTheGuaranteePlan }}</div>
</div>
</template>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
class-name="small-padding fixed-width"
width="330"
>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<!-- 添加或修改国际法规与关键件中间对话框 -->
<el-dialog v-model="open" :title="title" width="500px" append-to-body>
<el-form ref="partRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="备注" prop="remark">
<el-input
v-model="form.remark"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item>
<el-form-item label="${comment}" prop="delFlag">
<el-input v-model="form.delFlag" placeholder="请输入${comment}" />
</el-form-item>
<el-form-item label="零件表ID" prop="partId">
<el-input v-model="form.partId" placeholder="请输入零件表ID" />
</el-form-item>
<el-form-item label="标准编号" prop="standardNumberId">
<el-input
v-model="form.standardNumberId"
placeholder="请输入标准编号"
/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button class="btn-B" @click="submitForm"
>{{ cn.cancel }}/{{ en.cancel }}</el-button
>
<el-button class="btn-A" @click="cancel"
>{{ cn.submitForm }}/{{ en.submitForm }}</el-button
>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="Part">
/*import { listPart, getPart, delPart, addPart, updatePart } from "@/api/control/part";*/
import cn from '@/locales/controlPlan/relationshipManagement/internationalRegulationPart/cn.json'
import en from '@/locales/controlPlan/relationshipManagement/internationalRegulationPart/en.json'
const { proxy } = getCurrentInstance()
const partList = ref([])
const open = ref(false)
const loading = ref(false)
const showSearch = ref(true)
const ids = ref([])
const single = ref(true)
const multiple = ref(true)
const total = ref(0)
const title = ref('')
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
partId: null,
standardNumberId: null,
},
rules: {
createTime: [
{ required: true, message: '创建时间不能为空', trigger: 'blur' },
],
updateBy: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
updateTime: [
{ required: true, message: '更新时间不能为空', trigger: 'blur' },
],
partId: [{ required: true, message: '零件表ID不能为空', trigger: 'blur' }],
standardNumberId: [
{ required: true, message: '标准编号不能为空', trigger: 'blur' },
],
},
})
const { queryParams, form, rules } = toRefs(data)
/** 查询国际法规与关键件中间列表 */
function getList() {
loading.value = true
listPart(queryParams.value).then((response) => {
partList.value = response.rows
total.value = response.total
loading.value = false
})
}
// 取消按钮
function cancel() {
open.value = false
reset()
}
// 表单重置
function reset() {
form.value = {
id: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
delFlag: null,
partId: null,
standardNumberId: null,
}
proxy.resetForm('partRef')
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1
getList()
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm('queryRef')
handleQuery()
}
// 多选框选中数据
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.id)
single.value = selection.length != 1
multiple.value = !selection.length
}
/** 新增按钮操作 */
function handleAdd() {
reset()
open.value = true
title.value = '添加国际法规与关键件中间'
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset()
const _id = row.id || ids.value
getPart(_id).then((response) => {
form.value = response.data
open.value = true
title.value = '修改国际法规与关键件中间'
})
}
/** 提交按钮 */
function submitForm() {
proxy.$refs['partRef'].validate((valid) => {
if (valid) {
if (form.value.id != null) {
updatePart(form.value).then((response) => {
proxy.$modal.msgSuccess('修改成功')
open.value = false
getList()
})
} else {
addPart(form.value).then((response) => {
proxy.$modal.msgSuccess('新增成功')
open.value = false
getList()
})
}
}
})
}
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value
proxy.$modal
.confirm('是否确认删除国际法规与关键件中间编号为"' + _ids + '"的数据项?')
.then(function () {
return delPart(_ids)
})
.then(() => {
getList()
proxy.$modal.msgSuccess('删除成功')
})
.catch(() => {})
}
/** 导出按钮操作 */
function handleExport() {
proxy.download(
'control/part/export',
{
...queryParams.value,
},
`part_${new Date().getTime()}.xlsx`,
)
}
//getList();
</script>
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