Merge branch 'main' of http://47.97.125.165:8902/jiangs/lis8.0-vue3
This commit is contained in:
commit
1f386bf59c
@ -53,3 +53,13 @@ export function getstatsTemplate(params: any) {
|
|||||||
params
|
params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 模板参数查询详细信息
|
||||||
|
export function getstatsQuery(params: any) {
|
||||||
|
return request({
|
||||||
|
url: '/stats/query',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@ -54,7 +54,7 @@
|
|||||||
<el-button type="danger" :size="aotuSize" plain icon="Edit" @click="selectStatusRows">选中所有未打印</el-button>
|
<el-button type="danger" :size="aotuSize" plain icon="Edit" @click="selectStatusRows">选中所有未打印</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="success" :size="aotuSize" plain @click="printPdf">打印条码</el-button>
|
<el-button type="success" :size="aotuSize" plain :loading="dybtnLoading" @click="printPdf">打印条码</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="info" :size="aotuSize" plain icon="Upload" @click="openBlock('采样登记')">采样登记</el-button>
|
<el-button type="info" :size="aotuSize" plain icon="Upload" @click="openBlock('采样登记')">采样登记</el-button>
|
||||||
@ -723,6 +723,7 @@ const handletime = (val: Array<string>) => {
|
|||||||
|
|
||||||
|
|
||||||
const btnLoading = ref(false);
|
const btnLoading = ref(false);
|
||||||
|
const dybtnLoading = ref(false);
|
||||||
// 生成条码
|
// 生成条码
|
||||||
const printHandle = () => {
|
const printHandle = () => {
|
||||||
btnLoading.value = true;
|
btnLoading.value = true;
|
||||||
@ -809,19 +810,23 @@ const printPdf = () => {
|
|||||||
ElMessageBox.confirm(`确定打印选中的数据吗?`, "提示", {
|
ElMessageBox.confirm(`确定打印选中的数据吗?`, "提示", {
|
||||||
confirmButtonText: "确认",
|
confirmButtonText: "确认",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
beforeClose: async (action, instance, done) => {
|
beforeClose: (action, instance, done) => {
|
||||||
if (action === "confirm") {
|
if (action === "confirm") {
|
||||||
|
dybtnLoading.value = true;
|
||||||
const requests = selections.map((item: any) => item.sqh)
|
const requests = selections.map((item: any) => item.sqh)
|
||||||
const res = await fetchCodeExec({
|
fetchCodeExec({
|
||||||
sqh: requests.join(','),
|
sqh: requests.join(','),
|
||||||
userid: queryParams.userid,
|
userid: queryParams.userid,
|
||||||
status: 11,
|
status: 11,
|
||||||
yljg: queryParams.yljg
|
yljg: queryParams.yljg
|
||||||
|
}).then((res: any) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
done()
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
dybtnLoading.value = false;
|
||||||
})
|
})
|
||||||
if (res.code == 0) {
|
|
||||||
done()
|
|
||||||
getList()
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
done()
|
done()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -69,8 +69,7 @@
|
|||||||
import { getComDicts, } from "@/api/liswork/dict/ComDict";
|
import { getComDicts, } from "@/api/liswork/dict/ComDict";
|
||||||
import { useCommonStore } from '@/store/modules/commonStore';
|
import { useCommonStore } from '@/store/modules/commonStore';
|
||||||
import { classCom } from '@/utils/classCom';
|
import { classCom } from '@/utils/classCom';
|
||||||
import { listhospital } from "@/api/regional/dict/hospital.js";
|
import { getstatsTemplate, getstatsQuery } from "@/api/liswork/xtwh/StatsparameterApi";
|
||||||
import { getstatsTemplate } from "@/api/liswork/xtwh/StatsparameterApi";
|
|
||||||
import { listUser } from '@/api/system/user.js'
|
import { listUser } from '@/api/system/user.js'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { getDictData, formatDict } from '@/hooks'
|
import { getDictData, formatDict } from '@/hooks'
|
||||||
@ -92,7 +91,7 @@ const coloums = ref([]) //固定列
|
|||||||
const checkBoxs = ref([])
|
const checkBoxs = ref([])
|
||||||
|
|
||||||
const tableColumns = ref([]);
|
const tableColumns = ref([]);
|
||||||
|
const Template = ref({})
|
||||||
|
|
||||||
|
|
||||||
const instrGroupOptions = ref([])
|
const instrGroupOptions = ref([])
|
||||||
@ -115,39 +114,72 @@ const loadinstrGroupOptions = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handletime = () => {
|
const handletime = () => {
|
||||||
const dayDiff = classCom.getDayDiff(queryParams.st, queryParams.et)
|
// const dayDiff = classCom.getDayDiff(queryParams.st, queryParams.et)
|
||||||
if (dayDiff === -1 || dayDiff === -2) return ElMessage.warning('请选择有效的日期范围');
|
// if (dayDiff === -1 || dayDiff === -2) return ElMessage.warning('请选择有效的日期范围');
|
||||||
}
|
}
|
||||||
|
|
||||||
const search = () => {
|
const search = () => {
|
||||||
console.log('Parameter==>', Parameter.value);
|
const checkedCols = [...coloums.value, ...checkBoxs.value];
|
||||||
|
console.log('checkedCols==>', checkedCols);
|
||||||
|
const arr = [];
|
||||||
|
|
||||||
|
tableColumns.value.forEach((tableItem, tableIndex) => {
|
||||||
|
const matchItem = checkedCols.find(
|
||||||
|
(checkItem) => checkItem.paramName === tableItem.label
|
||||||
|
);
|
||||||
|
if (matchItem) {
|
||||||
|
arr.push({
|
||||||
|
...matchItem,
|
||||||
|
paramSort: tableIndex,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const unmatchedItems = checkedCols.filter(
|
||||||
|
(checkItem) => !tableColumns.value.some((tableItem) => tableItem.label === checkItem.paramName)
|
||||||
|
);
|
||||||
|
|
||||||
|
unmatchedItems.forEach((item, unmatchIndex) => {
|
||||||
|
arr.push({
|
||||||
|
...item,
|
||||||
|
paramSort: tableColumns.value.length + unmatchIndex,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = {
|
||||||
|
Parameter: Parameter.value,
|
||||||
|
Column: arr,
|
||||||
|
Template: Template.value
|
||||||
|
};
|
||||||
|
console.log('data==>', data);
|
||||||
|
getstatsQuery(data).then(res => {
|
||||||
|
tableData.value = res.data
|
||||||
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
const print = () => {
|
const print = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCheckBoxChange = (val) => {
|
const handleCheckBoxChange = (val) => {
|
||||||
tableColumns.value = val.map(paramCode => {
|
|
||||||
|
const checkedCols = val.map(paramCode => {
|
||||||
const matchItem = checkBoxs.value.find(item => item.paramCode === paramCode);
|
const matchItem = checkBoxs.value.find(item => item.paramCode === paramCode);
|
||||||
return matchItem ? {
|
return matchItem ? { label: matchItem.paramName, prop: matchItem.paramCode } : null;
|
||||||
label: matchItem.paramName,
|
}).filter(Boolean); // 过滤null
|
||||||
prop: matchItem.paramCode,
|
|
||||||
} : null;
|
|
||||||
})
|
const fixedCols = coloums.value.map(item => ({
|
||||||
const arr = coloums.value.map(item => {
|
label: item.paramName,
|
||||||
return {
|
prop: item.paramCode,
|
||||||
label: item.paramName,
|
}));
|
||||||
prop: item.paramCode,
|
|
||||||
}
|
|
||||||
})
|
tableColumns.value = [...checkedCols, ...fixedCols];
|
||||||
tableColumns.value = tableColumns.value.concat(arr)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取模板参数
|
||||||
|
|
||||||
|
|
||||||
const getParams = () => {
|
const getParams = () => {
|
||||||
getstatsTemplate({ statsCode: route.query && route.query.statsCode, }).then(res => {
|
getstatsTemplate({ StatsCode: route.query && route.query.statsCode, }).then(res => {
|
||||||
Parameter.value = res.data.Parameter
|
Parameter.value = res.data.Parameter
|
||||||
tableColumns.value = res.data.Column.filter(item => item.paramType == '6').map(item => {
|
tableColumns.value = res.data.Column.filter(item => item.paramType == '6').map(item => {
|
||||||
return {
|
return {
|
||||||
@ -160,6 +192,7 @@ const getParams = () => {
|
|||||||
coloums.value = res.data.Column.filter(item => item.paramType == '6')
|
coloums.value = res.data.Column.filter(item => item.paramType == '6')
|
||||||
|
|
||||||
checkBoxs.value = res.data.Column.filter(item => item.paramType != '6')
|
checkBoxs.value = res.data.Column.filter(item => item.paramType != '6')
|
||||||
|
Template.value = res.data.Template
|
||||||
statsTitle.value = res.data.Template.statsTitle
|
statsTitle.value = res.data.Template.statsTitle
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user