This commit is contained in:
sjl
2024-11-14 18:26:34 +08:00
parent 65cb7826d3
commit 87fe66da3e
42 changed files with 188 additions and 204 deletions

View File

@@ -349,21 +349,13 @@ import { el } from 'element-plus/es/locale'
{
formContent.value.arrivedDate = dayjs(formContent.value.arrivedDate).format('YYYY-MM-DD');
}
//console.log('1111'+formContent.value.arrivedDate)
if (formContent.value.id) {
const result = await updatePqDev(formContent.value);
if(result.code != 'A0000'){
ElMessage.error({ message: result.message})
}else{
ElMessage.success({ message: `${dialogTitle.value}成功!` })
}
await updatePqDev(formContent.value);
ElMessage.success({ message: `${dialogTitle.value}成功!` })
} else {
const result = await addPqDev(formContent.value);
if(result.code != 'A0000'){
ElMessage.error({ message: result.message})
}else{
ElMessage.success({ message: `${dialogTitle.value}成功!` })
}
await addPqDev(formContent.value);
ElMessage.success({ message: `${dialogTitle.value}成功!` })
}
close()
// 刷新表格

View File

@@ -64,7 +64,7 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
{
prop: 'name',
label: '名称',
search: { el: 'input',order:2,offset:0.1},
search: { el: 'input'},
minWidth: 200,
},
{
@@ -74,36 +74,12 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
fieldNames: { label: 'name', value: 'code' },
minWidth: 200,
},
{
prop: 'devChns',
label: '设备通道数',
minWidth: 110,
},
{
prop: 'devVolt',
label: '额定电压V',
minWidth: 130,
},
{
prop: 'devCurr',
label: '额定电流A',
minWidth: 130,
},
{
prop: 'manufacturer',
label: '生产厂商',
enum: dictStore.getDictData('Dev_Manufacturers'),
search: { el: 'select', props: { filterable: true }},
fieldNames: { label: 'name', value: 'code' },
minWidth: 200,
},
{
prop: 'createDate',
label: '生产日期',
minWidth: 200,
search: {
order:1,
span:2,
render: () => {
return (
<div class='flx-flex-start'>
@@ -117,6 +93,38 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
},
},
},
{
prop: 'devChns',
label: '设备通道数',
minWidth: 110,
render: scope => {
return String(scope.row.devChns) // 将数字转换为字符串
},
},
{
prop: 'devVolt',
label: '额定电压V',
minWidth: 130,
render: scope => {
return String(scope.row.devVolt) // 将数字转换为字符串
},
},
{
prop: 'devCurr',
label: '额定电流A',
minWidth: 130,
render: scope => {
return String(scope.row.devCurr) // 将数字转换为字符串
},
},
{
prop: 'manufacturer',
label: '生产厂商',
enum: dictStore.getDictData('Dev_Manufacturers'),
search: { el: 'select', props: { filterable: true },order:1},
fieldNames: { label: 'name', value: 'code' },
minWidth: 200,
},
{ prop: 'operation', label: '操作', fixed: 'right', width: 200 },
])
@@ -127,13 +135,10 @@ const endDate = ref('')
const handleDateChange = (startDateTemp: string, endDateTemp: string) => {
startDate.value = startDateTemp
endDate.value = endDateTemp
//console.log(startDateTemp)
//console.log(endDateTemp)
}
// 打开 drawer(新增、编辑)
const openDialog = (titleType: string, row: Partial<Device.ResPqDev> = {}) => {
devicePopup.value?.open(titleType, row)
console.log(columns)
}
// 批量删除设备
@@ -150,9 +155,16 @@ const handleDelete = async (params: Device.ResPqDev) => {
}
// 导出设备
const downloadFile = async () => {
const downloadFile = async (params: Device.ReqPqDevParams) => {
// 获取当前的搜索参数
const searchParam = proTable.value?.searchParam || {};
// 将开始时间和结束时间添加到搜索参数中
searchParam.searchBeginTime = startDate.value;
searchParam.searchEndTime = endDate.value;
ElMessageBox.confirm('确认导出被检设备?', '温馨提示', { type: 'warning' }).then(() =>
useDownload(exportPqDev, '被检设备导出数据', proTable.value?.searchParam, false,'.xlsx'),
useDownload(exportPqDev,'被检设备导出数据', proTable.value?.searchParam, false,'.xlsx'),
)
}

View File

@@ -288,7 +288,7 @@ const typeList = [
{
// 将表单数据转为json,发送到后端
let confirmFormData = JSON.parse(JSON.stringify(props.formData));
console.log(confirmFormData)
// console.log(confirmFormData)
emit('submit', props.formData); // 提交表单数据
emit('update:visible', false); // 提交后关闭对话框
}

View File

@@ -108,7 +108,7 @@ const columns = ref<ColumnProps<ErrorSystem.ErrorSystemList>[]>([
search: { el: 'select', props: { filterable: true } },
fieldNames: { label: 'label', value: 'code' },
},
{ prop: 'operation', label: '操作', fixed: 'right' ,width: 300,},
{ prop: 'operation', label: '操作', fixed: 'right' ,width: 250,},
])
// 打开编辑对话框

View File

@@ -18,7 +18,6 @@
</template>
<!-- 表格操作 -->
<template #operation='scope'>
<el-button type='primary' link :icon='View' >查看</el-button>
<el-button type='primary' link :icon='EditPen' >编辑</el-button>
<el-button type='primary' link :icon='Delete' >删除</el-button>
<el-button type='primary' :model-value="false" link :icon='Upload' >升级为模板</el-button>
@@ -114,7 +113,7 @@ const columns = reactive<ColumnProps<TestScript.TestScriptBO>[]>([
search: { el: 'select' },
minWidth: 150,
},
{ prop: 'operation', label: '操作', fixed: 'right', width: 330 },
{ prop: 'operation', label: '操作', fixed: 'right', width: 250 },
])

View File

@@ -103,7 +103,7 @@
search: { el: 'select' },
minWidth: 150,
},
{ prop: 'operation', label: '操作', fixed: 'right', width: 330 },
{ prop: 'operation', label: '操作', fixed: 'right', width: 250 },
])