Commit eb2d36d3 authored by Mr.Tang's avatar Mr.Tang

对应关系国内国际bug修复

parent f676ae7e
...@@ -3,7 +3,7 @@ import request from '@/utils/request' ...@@ -3,7 +3,7 @@ import request from '@/utils/request'
export function list(query) { export function list(query) {
return request({ return request({
url: '/control/lawPartMiddle/list', url: '/control/lawPartMiddle/list',
method: 'get', method: 'post',
data: query, data: query,
}) })
} }
......
...@@ -27,15 +27,6 @@ export function partDetails(query) { ...@@ -27,15 +27,6 @@ export function partDetails(query) {
}) })
} }
// 新增法规与关键件对应数据管理
export function addRelation(data) {
return request({
url: '/control/lawPartRelation/add',
method: 'post',
data: data,
})
}
// 修改法规与关键件对应数据管理 // 修改法规与关键件对应数据管理
export function updateRelation(data) { export function updateRelation(data) {
return request({ return request({
...@@ -56,8 +47,8 @@ export function addBatchRelation(query) { ...@@ -56,8 +47,8 @@ export function addBatchRelation(query) {
/** 移除对应关系 */ /** 移除对应关系 */
export function delRelation(id) { export function delRelation(id) {
return request({ return request({
url: '/control/lawPartRelation/del/' + id, url: `/control/lawPartRelation/del/${id}`,
method: 'delete', method: 'get',
}) })
} }
/**查询没有关联的零部件 */ /**查询没有关联的零部件 */
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"source": "来源", "source": "来源",
"standardName": "标准名称", "standardName": "标准名称",
"partName": "零件名称", "partName": "零件名称",
"notice": "共5个未关联法规的CQC关键零部件", "notice": "共个未关联法规的CQC关键零部件",
"serialNumber": "序号", "serialNumber": "序号",
"correspondingParts": "对应零件", "correspondingParts": "对应零件",
"createTime": "创建时间", "createTime": "创建时间",
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"source": "Source", "source": "Source",
"standardName": "Standard Name", "standardName": "Standard Name",
"partName": "Part Name", "partName": "Part Name",
"notice": "A total of 5 CQC key components not related to regulations", "notice": "CQC key components without associated regulations",
"serialNumber": "Serial Number", "serialNumber": "Serial Number",
"correspondingParts": "Corresponding Parts", "correspondingParts": "Corresponding Parts",
"order": "order", "order": "order",
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
> >
{{ unrelatedCount }} {{ unrelatedCount }}
</span> </span>
个未关联法规的CQC关键零部件 个未关联法规的CQC关键零部件/{{ unrelatedCount }} {{ en.notice }}
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -129,24 +129,31 @@ ...@@ -129,24 +129,31 @@
</el-table> </el-table>
<pagination <pagination
v-show="total > 0" v-show="paginationStates.mainTable.total > 0"
v-model:page="queryParams.pageNum" v-model:page="paginationStates.mainTable.pageNum"
v-model:limit="queryParams.pageSize" v-model:limit="paginationStates.mainTable.pageSize"
:total="total" :total="paginationStates.mainTable.total"
@pagination="getList" @pagination="getList"
/> />
</div> </div>
<!--待关联法规的CQC关键零部件--> <!--待关联法规的CQC关键零部件-->
<el-drawer v-model="open1" :title="title" append-to-body> <el-drawer v-model="open1" :title="title" append-to-body>
<el-form ref="partRef" :model="form" label-width="80px"> <el-form ref="partRef" :model="queryParams">
<el-row> <el-form-item
<el-form-item label="零件名称" prop="criticalPartNameCn"> :label="`${cn.partName}/${en.partName}`"
prop="criticalPartNameCn"
>
<el-input <el-input
v-model="queryParams.criticalPartNameCn" v-model="queryParams.criticalPartNameCn"
placeholder="请输入" :placeholder="`${cn.pleaseEnter}/${en.pleaseEnter}`"
clearable
style="width: 200px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="来源" prop="certificationBody"> <el-form-item
:label="`${cn.source}/${en.source}`"
prop="certificationBody"
>
<el-select <el-select
v-model="queryParams.certificationBody" v-model="queryParams.certificationBody"
:placeholder="`${cn.pleaseChoose}/${en.pleaseChoose}`" :placeholder="`${cn.pleaseChoose}/${en.pleaseChoose}`"
...@@ -165,11 +172,10 @@ ...@@ -165,11 +172,10 @@
<el-button class="btn-A" @click="handleQuery1"> <el-button class="btn-A" @click="handleQuery1">
{{ cn.search }}/{{ en.search }} {{ cn.search }}/{{ en.search }}
</el-button> </el-button>
<el-button class="btn-B" @click="resetQuery"> <el-button class="btn-B" @click="resetQuery1">
{{ cn.reset }}/{{ en.reset }} {{ cn.reset }}/{{ en.reset }}
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-row>
</el-form> </el-form>
<el-table <el-table
...@@ -232,7 +238,7 @@ ...@@ -232,7 +238,7 @@
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="lawList" :data="lawList"
@selection-change="handleSelectionChange" @selection-change="handleLawSelectionChange"
> >
<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="150" fixed="left"> <el-table-column label="序号" align="center" width="150" fixed="left">
...@@ -275,7 +281,7 @@ ...@@ -275,7 +281,7 @@
<el-button class="btn-B" @click="cancelRelationLaw" <el-button class="btn-B" @click="cancelRelationLaw"
>{{ cn.cancel }}/{{ en.cancel }}</el-button >{{ cn.cancel }}/{{ en.cancel }}</el-button
> >
<el-button class="btn-A" @click="addRelations" <el-button class="btn-A" @click="addLawRelations"
>{{ cn.submitForm }}/{{ en.submitForm }}</el-button >{{ cn.submitForm }}/{{ en.submitForm }}</el-button
> >
</div> </div>
...@@ -284,10 +290,19 @@ ...@@ -284,10 +290,19 @@
<!-- 查看对应零件 --> <!-- 查看对应零件 -->
<el-drawer v-model="open2" :title="title" append-to-body> <el-drawer v-model="open2" :title="title" append-to-body>
<el-form ref="partRef" :model="form" :rules="rules" label-width="70px"> <el-form
ref="partRef"
:model="queryParams"
:rules="rules"
label-width="70px"
>
<el-row> <el-row>
<el-form-item label="零件名称" prop="partName"> <el-form-item label="零件名称" prop="criticalPartNameCn">
<el-input v-model="form.partName" placeholder="请输入" /> <el-input
v-model="queryParams.criticalPartNameCn"
placeholder="请输入"
clearable
/>
</el-form-item> </el-form-item>
<el-form-item label="来源" prop="certificationBody"> <el-form-item label="来源" prop="certificationBody">
<el-select <el-select
...@@ -305,10 +320,10 @@ ...@@ -305,10 +320,10 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button class="btn-A" @click="handleQuery" <el-button class="btn-A" @click="handleQuery2"
>{{ cn.search }}/{{ en.search }}</el-button >{{ cn.search }}/{{ en.search }}</el-button
> >
<el-button class="btn-B" @click="resetQuery" <el-button class="btn-B" @click="resetQuery2"
>{{ cn.reset }}/{{ en.reset }}</el-button >{{ cn.reset }}/{{ en.reset }}</el-button
> >
<el-button class="btn-C" @click="handleAdd" <el-button class="btn-C" @click="handleAdd"
...@@ -430,7 +445,6 @@ import { ...@@ -430,7 +445,6 @@ import {
partDetails, partDetails,
addBatchRelation, addBatchRelation,
selectCanRelateLaw, selectCanRelateLaw,
addRelation,
updateRelation, updateRelation,
delRelation, delRelation,
} from '@/api/RelationManagement/baseLawPartRelation' } from '@/api/RelationManagement/baseLawPartRelation'
...@@ -462,29 +476,23 @@ const addPartsList = ref([]) ...@@ -462,29 +476,23 @@ const addPartsList = ref([])
// 存储选中行的数据 // 存储选中行的数据
const selectedRows = ref([]) const selectedRows = ref([])
// 定义行唯一标识(根据实际字段调整) // 定义行唯一标识(根据实际字段调整)
// 在 setup() 或 script setup 中定义响应式变量
const currentStandardNo = ref('') const currentStandardNo = ref('')
const currentPartName = ref('') // 存储当前操作的零件名称
const selectedLaws = ref([]) // 存储选中的法规数据
const getRowKey = (row) => row.id // 假设每行有唯一id字段 const getRowKey = (row) => row.id // 假设每行有唯一id字段
const paginationStates = reactive({
// 主表格分页
mainTable: {
pageNum: 1,
pageSize: 10,
total: 0,
},
})
const queryForm = reactive({ const queryForm = reactive({
standardNo: '', standardNo: '',
criticalPartNameCn: '', criticalPartNameCn: '',
certificationBody: '', certificationBody: '',
}) })
const queryParams1 = [
{
pageNum: 1,
pageSize: 10,
id: null,
partId: null,
partName: null,
standardNo: null,
standardName: null,
standardNumber: null,
criticalPartNameCn: null,
criticalPartNameEn: null,
certificationBody: null,
},
]
const data = reactive({ const data = reactive({
form: {}, form: {},
...@@ -499,7 +507,6 @@ const data = reactive({ ...@@ -499,7 +507,6 @@ const data = reactive({
standardNumber: null, standardNumber: null,
criticalPartNameCn: null, criticalPartNameCn: null,
criticalPartNameEn: null, criticalPartNameEn: null,
certificationBody: null,
}, },
rules: { rules: {
createTime: [ createTime: [
...@@ -518,10 +525,14 @@ const { queryParams, form, rules } = toRefs(data) ...@@ -518,10 +525,14 @@ const { queryParams, form, rules } = toRefs(data)
/** 查询国内法规与关键件 */ /** 查询国内法规与关键件 */
function getList() { function getList() {
loading.value = true loading.value = true
listRelation(queryParams.value).then((response) => { listRelation({
...queryParams.value,
pageNum: paginationStates.mainTable.pageNum,
pageSize: paginationStates.mainTable.pageSize,
}).then((response) => {
//console.log('789', response) //console.log('789', response)
partList.value = response.rows partList.value = response.rows
total.value = response.total paginationStates.mainTable.total = response.total
loading.value = false loading.value = false
}) })
} }
...@@ -535,28 +546,38 @@ function openDialogForNotRelation() { ...@@ -535,28 +546,38 @@ function openDialogForNotRelation() {
/**查看没有关联法规的零件*/ /**查看没有关联法规的零件*/
function getSelectNoRelateLawPart() { function getSelectNoRelateLawPart() {
loading.value = true loading.value = true
selectNoRelatePart(queryParams).then((response) => { selectNoRelatePart(queryParams.value).then((response) => {
noRelateCQCList.value = response noRelateCQCList.value = response
// 确保使用正确的响应数据结构 // 确保使用正确的响应数据结构
total.value = response.length total.value = response.length
loading.value = false loading.value = false
// 将总数传递到模板中 /*updateUnrelatedCount(total.value)*/
updateUnrelatedCount(total.value)
}) })
} }
/**查看没有关联的零件*/ /**查看没有关联的零件*/
function getSelectNoRelatePart() { function getSelectNoRelatePart() {
loading.value = true loading.value = true
selectNoRelatePart(queryParams).then((response) => { const params = {
...queryParams, // 保留其他参数(如果有)
certificationBody: '1', // 强制设置为字符串 '1'
}
selectNoRelatePart(params)
.then((response) => {
addRelationList.value = response addRelationList.value = response
// 确保使用正确的响应数据结构
total.value = response.length total.value = response.length
loading.value = false
// 将总数传递到模板中 // 统计 certificationBody == '手动' 的数据数量
updateUnrelatedCount(total.value) const manualCount = response.filter(
(item) => item.certificationBody === '手动',
).length
// 将统计结果传递给更新函数
updateUnrelatedCount(manualCount)
})
.finally(() => {
loading.value = false
}) })
} }
...@@ -602,6 +623,18 @@ function handleQuery1() { ...@@ -602,6 +623,18 @@ function handleQuery1() {
//queryParams.value.pageNum = 1 //queryParams.value.pageNum = 1
getSelectNoRelateLawPart() getSelectNoRelateLawPart()
} }
function resetQuery1() {
proxy.resetForm('queryRef')
handleQuery1()
}
function handleQuery2() {
//queryParams.value.pageNum = 1
getPartDetail()
}
function resetQuery2() {
proxy.resetForm('queryRef')
handleQuery2()
}
/** 重置按钮操作 */ /** 重置按钮操作 */
function resetQuery() { function resetQuery() {
proxy.resetForm('queryRef') proxy.resetForm('queryRef')
...@@ -630,7 +663,10 @@ function showPartDialog(row) { ...@@ -630,7 +663,10 @@ function showPartDialog(row) {
function getPartDetail(row) { function getPartDetail(row) {
// 2. 发起请求 // 2. 发起请求
loading.value = true loading.value = true
partDetails({ standardNo: currentStandardNo.value }) partDetails({
...queryParams.value,
standardNo: currentStandardNo.value,
})
.then((response) => { .then((response) => {
partDetailsList.value = response.data || response // 兼容不同API结构 partDetailsList.value = response.data || response // 兼容不同API结构
total.value = partDetailsList.value.length total.value = partDetailsList.value.length
...@@ -644,16 +680,25 @@ function getPartDetail(row) { ...@@ -644,16 +680,25 @@ function getPartDetail(row) {
} }
/*选择要关联的法规弹框*/ /*选择要关联的法规弹框*/
function handleRelation() { function handleRelation(row) {
currentPartName.value = row.criticalPartNameCn // 存储零件名称
currentStandardNo.value = '' // 清空之前的标准编号
//lawStandardName.value = row.standardNumber
open.value = true open.value = true
title.value = '选择要关联的法规' title.value = '选择要关联的法规'
handleRelationLaw() handleRelationLaw(row)
}
// 修改法规选择处理
const handleLawSelectionChange = (selection) => {
selectedLaws.value = selection
} }
/*查询所有关联法规*/ /*查询所有关联法规*/
function handleRelationLaw() { function handleRelationLaw(row) {
loading.value = true loading.value = true
selectCanRelateLaw(queryParams) selectCanRelateLaw({
standardNo: row.standardNumber,
standardName: row.criticalPartNameCn,
})
.then((response) => { .then((response) => {
//console.log('8767837837', response) //console.log('8767837837', response)
lawList.value = response.rows lawList.value = response.rows
...@@ -695,10 +740,10 @@ function handleDelete(row) { ...@@ -695,10 +740,10 @@ function handleDelete(row) {
proxy.$modal proxy.$modal
.confirm('是否确认删除编号为"' + _ids + '"的数据项?') .confirm('是否确认删除编号为"' + _ids + '"的数据项?')
.then(function () { .then(function () {
return delPart(_ids) return delRelation(_ids)
}) })
.then(() => { .then(() => {
getList() getPartDetail()
proxy.$modal.msgSuccess('删除成功') proxy.$modal.msgSuccess('删除成功')
}) })
.catch(() => {}) .catch(() => {})
...@@ -720,10 +765,33 @@ function addRelations() { ...@@ -720,10 +765,33 @@ function addRelations() {
proxy.$modal.msgSuccess('新增成功') proxy.$modal.msgSuccess('新增成功')
open3.value = false open3.value = false
getPartDetail() getPartDetail()
handleRelationLaw()
selectedRows.value = [] // 清空选中状态 selectedRows.value = [] // 清空选中状态
}) })
} }
function addLawRelations() {
if (selectedLaws.value.length === 0) {
proxy.$modal.msgWarning('请至少选择一条法规数据')
return
}
const requestData = selectedLaws.value.map((law) => ({
partName: currentPartName.value,
standardNo: law.standardNumber, // 使用选中法规的编号
}))
addBatchRelation(requestData).then(() => {
proxy.$modal.msgSuccess('关联成功')
open.value = false
// 刷新相关数据
getList()
getSelectNoRelateLawPart()
// 清空状态
currentPartName.value = ''
selectedLaws.value = []
currentStandardNo.value = ''
})
}
/** 提交按钮 */ /** 提交按钮 */
function submitForm() { function submitForm() {
proxy.$refs['partRef'].validate((valid) => { proxy.$refs['partRef'].validate((valid) => {
......
...@@ -167,27 +167,35 @@ ...@@ -167,27 +167,35 @@
<!-- 维护类型描述抽屉 --> <!-- 维护类型描述抽屉 -->
<el-drawer v-model="open" :title="title" width="800px" append-to-body> <el-drawer v-model="open" :title="title" width="800px" append-to-body>
<el-form ref="middleRef" :model="form" :rules="rules" label-width="80px"> <el-form
ref="middleRef"
:model="queryParams"
:rules="rules"
label-width="80px"
>
<el-row> <el-row>
<el-form-item label="项目" prop="project"> <el-form-item label="项目" prop="typeDescription">
<el-input placeholder="请输入" style="width: 150px" /> <el-input
v-model="queryParams.typeDescription"
placeholder="请输入"
style="width: 150px"
/>
</el-form-item> </el-form-item>
<el-button <el-button
style="margin-left: 10px; width: 110px" style="margin-left: 10px; width: 110px"
class="btn-A" class="btn-A"
@click="handleQuery" @click="handleQuery2"
>{{ cn.search }}/{{ en.search }}</el-button >{{ cn.search }}/{{ en.search }}</el-button
> >
<el-button class="btn-B" @click="resetQuery" <el-button class="btn-B" @click="resetQuery2"
>{{ cn.reset }}/{{ en.reset }}</el-button >{{ cn.reset }}/{{ en.reset }}</el-button
> >
<el-button class="btn-C" @click="handleAdd" <el-button class="btn-C" @click="() => handleAdd(currentRow)"
>{{ cn.add }}/{{ en.add }}</el-button >{{ cn.add }}/{{ en.add }}</el-button
> >
</el-row> </el-row>
</el-form> </el-form>
<el-table <el-table
:key="drawerPartKey"
v-loading="loading" v-loading="loading"
:data="drawerPartList" :data="drawerPartList"
border border
...@@ -335,16 +343,19 @@ ...@@ -335,16 +343,19 @@
</el-dialog> </el-dialog>
<!-- 查看对应零件 --> <!-- 查看对应零件 -->
<el-drawer v-model="open2" :title="title" append-to-body> <el-drawer v-model="open2" :title="title" append-to-body>
<el-form ref="partRef" :model="form" label-width="70px"> <el-form ref="middleRef" :model="queryParams" label-width="70px">
<el-row> <el-row>
<el-form-item label="零件名称" prop="partName"> <el-form-item label="零件名称" prop="criticalPartNameCn">
<el-input v-model="form.partName" placeholder="请输入" /> <el-input
v-model="queryParams.criticalPartNameCn"
placeholder="请输入"
/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button class="btn-A" @click="handleQuery" <el-button class="btn-A" @click="handleQuery1"
>{{ cn.search }}/{{ en.search }}</el-button >{{ cn.search }}/{{ en.search }}</el-button
> >
<el-button class="btn-B" @click="resetQuery" <el-button class="btn-B" @click="resetQuery1"
>{{ cn.reset }}/{{ en.reset }}</el-button >{{ cn.reset }}/{{ en.reset }}</el-button
> >
</el-form-item> </el-form-item>
...@@ -439,8 +450,22 @@ const multiple = ref(true) ...@@ -439,8 +450,22 @@ const multiple = ref(true)
const total = ref(0) const total = ref(0)
const title = ref('') const title = ref('')
const partDetailsList = ref([]) const partDetailsList = ref([])
const currentRow = ref(null) // 存储当前行的数据 const currentStandardName = ref('')
const currentStandardNo = ref('')
// 在父组件中定义当前行数据
const currentRow = ref({})
// 修改后的数据部分
const drawerData = ref({
open: false,
title: '',
currentStandardName: '',
list: [],
query: {
pageNum: 1,
pageSize: 10,
standardName: '',
},
})
const data = reactive({ const data = reactive({
form: {}, form: {},
queryParams: { queryParams: {
...@@ -478,16 +503,6 @@ function getList() { ...@@ -478,16 +503,6 @@ function getList() {
}) })
} }
function listAll() {
loading.value = true
list(queryParams.value).then((response) => {
drawerPartList.value = response
console.log('------------------', response)
total.value = response.total
loading.value = false
})
}
// 取消按钮 // 取消按钮
function cancel() { function cancel() {
open.value = false open.value = false
...@@ -506,13 +521,14 @@ function reset() { ...@@ -506,13 +521,14 @@ function reset() {
delFlag: null, delFlag: null,
partId: null, partId: null,
standardNumberId: null, standardNumberId: null,
typeDescription: null,
} }
proxy.resetForm('middleRef') proxy.resetForm('middleRef')
} }
/*查看零件详情抽屉*/ /*查看零件详情抽屉*/
function showPartDialog(row) { function showPartDialog(row) {
//currentRow.value = row // 保存当前行 currentStandardName.value = row.standardName // 保存当前行的 standardName
open2.value = true // 打开对话框 open2.value = true // 打开对话框
this.title = `查看对应零件(${row.standardNumber},共${row.partCount}个零件)` // 设置对话框标题 this.title = `查看对应零件(${row.standardNumber},共${row.partCount}个零件)` // 设置对话框标题
getPartDetail(row) getPartDetail(row)
...@@ -521,7 +537,11 @@ function getPartDetail(row) { ...@@ -521,7 +537,11 @@ function getPartDetail(row) {
// 2. 发起请求 // 2. 发起请求
loading.value = true loading.value = true
console.log('row', row) console.log('row', row)
partDetails({ standardNo: row.standardNumber }) currentStandardNo.value = row.standardNumber
partDetails({
...queryParams.value,
standardNo: currentStandardNo.value,
})
.then((response) => { .then((response) => {
partDetailsList.value = response.data || response // 兼容不同API结构 partDetailsList.value = response.data || response // 兼容不同API结构
total.value = partDetailsList.value.length total.value = partDetailsList.value.length
...@@ -545,6 +565,30 @@ function resetQuery() { ...@@ -545,6 +565,30 @@ function resetQuery() {
proxy.resetForm('middleRef') proxy.resetForm('middleRef')
handleQuery() handleQuery()
} }
function handleQuery1() {
queryParams.value.pageNum = 1
getPartDetail({
criticalPartNameCn: queryParams.value.criticalPartNameCn,
standardNo: currentStandardNo.value, // 确保此处已赋值
})
}
/** 重置按钮操作 */
function resetQuery1() {
proxy.resetForm('middleRef')
handleQuery1()
}
function handleQuery2() {
//queryParams.value.pageNum = 1
listAll()
}
/** 重置按钮操作 */
function resetQuery2() {
proxy.resetForm('middleRef')
handleQuery2()
}
// 多选框选中数据 // 多选框选中数据
function handleSelectionChange(selection) { function handleSelectionChange(selection) {
...@@ -554,10 +598,16 @@ function handleSelectionChange(selection) { ...@@ -554,10 +598,16 @@ function handleSelectionChange(selection) {
} }
/** 新增按钮操作 */ /** 新增按钮操作 */
function handleAdd() { function handleAdd(row) {
reset() reset()
open1.value = true open1.value = true
title.value = '新增类型描述' title.value = '新增类型描述'
// 确保 standardName 的来源
if (row?.standardName) {
form.value.standardName = row.standardName
} else if (currentRow.value?.standardName) {
form.value.standardName = currentRow.value.standardName
}
} }
/** 修改按钮操作 */ /** 修改按钮操作 */
...@@ -567,15 +617,55 @@ function openDialogOpen1(row) { ...@@ -567,15 +617,55 @@ function openDialogOpen1(row) {
} }
// 维护类型描述抽屉 // 维护类型描述抽屉
function handleMaintain(row) { function handleMaintain(row) {
reset() currentRow.value = row
const { id, standardName } = row console.log('main', row)
const _id = id || ids.value currentStandardName.value = row.standardName
list(_id, standardName).then((response) => {
drawerPartList.value = response
title.value = '维护类型描述' title.value = '维护类型描述'
open.value = true open.value = true
listAll(row)
}
function listAll(row = currentRow.value) {
loading.value = true
list({
// 显式声明为 URL 参数
...queryParams.value,
standardName: row?.standardName,
}).then((response) => {
drawerPartList.value = response.data || response
total.value = response.length || response.total
loading.value = false
}) })
} }
// 修改后的方法部分
/*function handleMaintain(row) {
drawerData.value = {
...drawerData.value,
open: true,
title: `维护类型描述`,
currentStandardName: row.standardName,
query: {
...drawerData.value.query,
standardName: row.standardName,
},
}
listAll() // 立即加载数据
}
// 修改后的数据获取方法
function listAll() {
loading.value = true
list({
...drawerData.value.query,
standardName: drawerData.value.currentStandardName, // 确保使用当前标准名称
})
.then((response) => {
drawerData.value.list = response.rows || response
drawerData.value.total = response.total || response.length
})
.finally(() => {
loading.value = false
})
}*/
// 编辑对话框 // 编辑对话框
function handleEdit(row) { function handleEdit(row) {
reset() reset()
...@@ -584,20 +674,28 @@ function handleEdit(row) { ...@@ -584,20 +674,28 @@ function handleEdit(row) {
open1.value = true open1.value = true
} }
/** 提交按钮 */ /** 提交按钮 */
function submitForm() { function submitForm(row) {
proxy.$refs['middleRef'].validate((valid) => { proxy.$refs['middleRef'].validate((valid) => {
if (valid) { if (valid) {
if (form.value.id != null) { if (form.value.id != null) {
updateMiddle(form.value).then((response) => { updateMiddle({
...form.value,
standardName: row.standardName,
}).then((response) => {
proxy.$modal.msgSuccess('修改成功') proxy.$modal.msgSuccess('修改成功')
open1.value = false open1.value = false
listAll() listAll()
getList()
}) })
} else { } else {
addMiddle(form.value).then((response) => { addMiddle({
...form.value,
standardName: form.value.standardName,
}).then((response) => {
proxy.$modal.msgSuccess('新增成功') proxy.$modal.msgSuccess('新增成功')
open1.value = false open1.value = false
listAll() listAll()
getList()
}) })
} }
} }
...@@ -631,7 +729,6 @@ function handleExport() { ...@@ -631,7 +729,6 @@ function handleExport() {
} }
/** 修改按钮操作 */ /** 修改按钮操作 */
const handleMoveUp = async (row) => { const handleMoveUp = async (row) => {
console.log()
try { try {
await moveUp(row.id) await moveUp(row.id)
proxy.$modal.msgSuccess('上移成功') proxy.$modal.msgSuccess('上移成功')
...@@ -659,5 +756,4 @@ function colseDialogOpen1() { ...@@ -659,5 +756,4 @@ function colseDialogOpen1() {
open1.value = false open1.value = false
} }
getList() getList()
listAll()
</script> </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