This commit is contained in:
sjl
2024-12-16 15:25:30 +08:00
parent d061fc9b32
commit 5da07d8631
3 changed files with 32 additions and 56 deletions

View File

@@ -3,16 +3,14 @@
<!-- :request-api="getTableList" -->
<ProTable
ref="proTable"
:columns="columns"
:data ='deviceData'
@drag-sort="sortTable"
:default-sort="{ prop: 'check_State', order: 'ascending' }"
:stripe="true"
:pagination = "false"
:key="tableKey"
@selection-change='handleSelectionChange'
:request-api='getTableList'
:request-api='getTableList'
>
<!-- :height="tableHeight" -->
<!-- 表格 header 按钮 -->
@@ -285,24 +283,7 @@ const shouldShowOption = (item) => {
return !item.disabled;
};
const plan_devicedata = [
{
id: '1', //装置序号ID
name: '240001', //设备名称
dev_Type: 'PQS-882B4',//设备类型
dev_Chns: 4, //设备通道数
check_Result: '未检', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数
}]
//console.log(window.innerHeight, "+++++++++");
tableHeight.value = window.innerHeight - 600;
//const deviceData = deviceDataList.plan_devicedata
const deviceData = ref<Device.ResPqDev[]>([]);
deviceData.value = deviceDataList.plan_devicedata.filter((item) => item.document_State === "未归档")
const operationShow = ref(false);
@@ -344,8 +325,8 @@ let checkStatusList = reactive([
]);
//检测报告状态数据
let checkReportStatusList = reactive([
{
label: "未检",
{
label: "已生成",
value: 0,
disabled: false,
},
@@ -354,26 +335,21 @@ let checkReportStatusList = reactive([
value: 1,
disabled: false,
},
{
label: "已生成",
value: 2,
disabled: false,
},
]);
//检测结果数组
let checkResultList = reactive([
{
label: "未检",
label: "不符合",
value: 0,
disabled: false,
},
{
label: "符合",
label: "符合",
value: 1,
disabled: false,
},
{
label: "符合",
label: "未检",
value: 2,
disabled: false,
},
@@ -415,24 +391,11 @@ const dataCallback = (data: any) => {
total: data.length || data.total, //total
};
};
// 如果你想在请求之前对当前请求参数做一些操作可以自定义如下函数params 为当前所有的请求参数(包括分页),最后返回请求列表接口
// 默认不做操作就直接在 ProTable 组件上绑定 :requestApi="getUserList"
// const getTableList = (params: any) => {
// console.log('11111111111111111',props.id);
// let newParams = JSON.parse(JSON.stringify(params));
// newParams.createTime && (newParams.startTime = newParams.createTime[0]);
// newParams.createTime && (newParams.endTime = newParams.createTime[1]);
// delete newParams.createTime;
// return getPlanList(newParams);
// };
const boundPqDevList=ref<Device.ReqPqDevParams[]>([])//根据检测计划id查询出所有已绑定的设备
const getTableList = async (params: any) => {
deviceData.value = plan_devicedata.filter((item) => item.document_State === "未归档")
const pqDevList_Result2 = await getBoundPqDevList({'planId': props.id, 'checkStateList':[0,1,2]});
boundPqDevList.value = pqDevList_Result2.data as Device.ReqPqDevParams[];
console.log('qwe',boundPqDevList.value)
@@ -482,6 +445,11 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
minWidth: 100,
sortable:true,
isShow:checkStateShow,
render: scope => {
return (
scope.row.checkState === 0 ? '未检' : scope.row.checkState === 1 ? '检测中' : '检测完成'
)
},
},
{
prop: 'checkResult',
@@ -489,14 +457,12 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
minWidth: 100,
sortable:true,
render: (scope) => {
if (scope.row.checkResult === 2)
if (scope.row.checkResult === 0)
{
return (<el-tag type='danger'>{ scope.row.checkResult }</el-tag>)
}
else
{
return (<span>{ scope.row.checkResult }</span>)
}
return <el-tag type='danger'>不符合</el-tag>
}else{
return scope.row.checkState === 1 ? '符合' : '未检'
}
},
},
{
@@ -504,6 +470,11 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
label: '报告状态',
minWidth: 100,
sortable:true,
render: scope => {
return (
scope.row.checkState === 0 ? '已生成' : '未生成'
)
},
},
{
prop: 'documentState',

View File

@@ -42,7 +42,7 @@
:legendData="{
icon: 'circle',
left: 'left',
top: 'middle',
top: 'bottom',
}"
:chartsData="chartsData1"
ref="pieRef1"
@@ -57,7 +57,7 @@
:legendData="{
icon: 'circle',
left: 'left',
top: 'middle',
top: 'bottom',
}"
:chartsData="chartsData2"
ref="pieRef2"
@@ -77,7 +77,7 @@
:legendData="{
icon: 'circle',
left: 'left',
top: 'middle',
top: 'bottom',
}"
:chartsData="chartsData3"
ref="pieRef3"
@@ -346,7 +346,7 @@ const planDetail = () => {
};
//功能选择css切换
const handleCheckFunction = (val: any) => {
console.log('点击了css切换');
editableTabsValue.value = '0';
form.value.activeChildTabs = 0;
tabsList.value.map((item: any, index: any) => {

View File

@@ -125,7 +125,12 @@
try {
dialogFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
// 确保 standardTime 是 Date 对象
if (formContent.value.standardTime) {
const date = new Date(formContent.value.standardTime);
formContent.value.standardTime = date.getFullYear().toString();
}
formContent.value.pqErrSysDtlsList = tableData.value
if (formContent.value.id) {
await updatePqErrSys(formContent.value);