字典
This commit is contained in:
parent
ac9d30434b
commit
6a37d14707
21
src/api/checkCode/index.ts
Normal file
21
src/api/checkCode/index.ts
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
//@ts-ignore js语法检查忽略
|
||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
// 生成条码
|
||||||
|
export function addObj(query?: Object) {
|
||||||
|
return request({
|
||||||
|
url: 'zyreq/add',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 查询申请单列表
|
||||||
|
export function fetchCodeList(query?: Object) {
|
||||||
|
return request({
|
||||||
|
url: '/zyreq/query',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
});
|
||||||
|
}
|
||||||
@ -148,7 +148,7 @@ import { HiprintPrinter } from '@/utils/print-utils';
|
|||||||
import CustomTable from '@/components/tableCom/index.vue'
|
import CustomTable from '@/components/tableCom/index.vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { usePrintStore } from '@/store/modules/printStore' // 引入 Pinia store
|
import { usePrintStore } from '@/store/modules/printStore' // 引入 Pinia store
|
||||||
// import { download } from '@/api/liswork/dict/LabInstr.js'
|
import { fetchCodeList, addObj } from '@/api/checkCode/index'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const printStore = usePrintStore();
|
const printStore = usePrintStore();
|
||||||
@ -340,7 +340,7 @@ const goReport = () => {
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
adjustTableHeight();
|
adjustTableHeight();
|
||||||
|
getList()
|
||||||
});
|
});
|
||||||
|
|
||||||
// 计算table高度
|
// 计算table高度
|
||||||
@ -361,20 +361,31 @@ function adjustTableHeight() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 生成条码
|
||||||
const printHandle = () => {
|
const printHandle = () => {
|
||||||
const url = 'http://47.97.125.165:8904/lis.pdf'
|
const data = {
|
||||||
HiprintPrinter.silentPrintPdf(
|
dept: 123,
|
||||||
url,
|
userid: 'lis',
|
||||||
{
|
st: '2025-01-01 00:00:00',
|
||||||
// 自定义打印参数(可选)
|
et: '2025-05-21 23:59:59',
|
||||||
orientation: "portrait", // 纵向(landscape=横向)
|
yljg: 1
|
||||||
copies: 1,
|
}
|
||||||
monochrome: false, // 是否黑白打印
|
addObj(data).then((res: any) => {
|
||||||
},
|
if (res.code == 0) {
|
||||||
);
|
getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询申请单
|
||||||
|
const getList = () => {
|
||||||
|
fetchCodeList({ sqh: '20221201167864' }).then((response: any) => {
|
||||||
|
if (response.code == 0) {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
const printHandle1 = () => {
|
const printHandle1 = () => {
|
||||||
const url = 'http://47.97.125.165:8904/lis.pdf'
|
const url = 'http://47.97.125.165:8904/lis.pdf'
|
||||||
HiprintPrinter.silentPrintPdf(
|
HiprintPrinter.silentPrintPdf(
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from "vue";
|
import { computed, reactive, ref, onMounted, nextTick } from "vue";
|
||||||
import { getToken } from "@/utils/auth";
|
import { getToken } from "@/utils/auth";
|
||||||
import { queryComDictListService, addComDictService, updateComDictService } from "../../../api/liswork/dict/ComDict.js";
|
import { queryComDictListService, addComDictService, updateComDictService } from "../../../api/liswork/dict/ComDict.js";
|
||||||
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
|
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
@ -20,6 +21,7 @@ const data = reactive({
|
|||||||
dictType: [{ required: true, message: "字典类型不能为空", trigger: "blur" }]
|
dictType: [{ required: true, message: "字典类型不能为空", trigger: "blur" }]
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
const single = ref(true);
|
const single = ref(true);
|
||||||
const multiple = ref(true);
|
const multiple = ref(true);
|
||||||
@ -50,7 +52,33 @@ const upload = reactive({
|
|||||||
// 上传的地址
|
// 上传的地址
|
||||||
url: import.meta.env.VITE_APP_BASE_API + "/comdict/importData"
|
url: import.meta.env.VITE_APP_BASE_API + "/comdict/importData"
|
||||||
});
|
});
|
||||||
|
const treeRef = ref(null)
|
||||||
|
const defaultProps = {
|
||||||
|
children: 'children',
|
||||||
|
label: 'zdmc',
|
||||||
|
id: 'zddh'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
watch(zdlbmc, (val) => {
|
||||||
|
console.log(ref(treeRef.value));
|
||||||
|
|
||||||
|
treeRef.value?.filter(val)
|
||||||
|
})
|
||||||
|
|
||||||
|
const filterNode = (value, data) => {
|
||||||
|
console.log(value, data);
|
||||||
|
|
||||||
|
if (!value) return true
|
||||||
|
return data.zdmc.includes(value)
|
||||||
|
}
|
||||||
|
|
||||||
|
const nodeHandle = (data) => {
|
||||||
|
queryParams.value.pageNum = 1
|
||||||
|
queryParams.value.zdlb = data.zddh;
|
||||||
|
getList()
|
||||||
|
// resetData(data.zdlb)
|
||||||
|
}
|
||||||
function resetData(zdlb) {
|
function resetData(zdlb) {
|
||||||
queryParams.value = {
|
queryParams.value = {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@ -61,7 +89,6 @@ function resetData(zdlb) {
|
|||||||
yljg: '1'
|
yljg: '1'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTypeList() {
|
function getTypeList() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
queryParams.value.pageSize = 1000;
|
queryParams.value.pageSize = 1000;
|
||||||
@ -71,18 +98,17 @@ function getTypeList() {
|
|||||||
total.value = response.total;
|
total.value = response.total;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
resetData()
|
resetData()
|
||||||
|
queryParams.value.zdlb = response.rows[1].zddh
|
||||||
|
getList()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function refreshDetail(zdlb) {
|
|
||||||
queryParams.value.zdlb = zdlb;
|
|
||||||
getList()
|
|
||||||
resetData(zdlb)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/** 查询字典明细列表 */
|
/** 查询字典明细列表 */
|
||||||
function getList() {
|
function getList() {
|
||||||
|
|
||||||
|
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
queryComDictListService(queryParams.value).then(response => {
|
queryComDictListService(queryParams.value).then(response => {
|
||||||
typeDetail.value = response.rows;
|
typeDetail.value = response.rows;
|
||||||
@ -110,10 +136,8 @@ function reset() {
|
|||||||
}
|
}
|
||||||
//重置
|
//重置
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
queryParams.value = {
|
queryParams.value.zdmc = ''
|
||||||
zdmc: '',
|
queryParams.value.zddh = ''
|
||||||
zddh: ''
|
|
||||||
}
|
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef");
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
@ -130,8 +154,9 @@ function handleAdd() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//修改
|
//修改
|
||||||
function handleUpdate() {
|
function handleUpdate(row) {
|
||||||
|
form.value = row
|
||||||
|
open.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//删除
|
//删除
|
||||||
@ -174,7 +199,7 @@ const handleFileSuccess = (response, file, fileList) => {
|
|||||||
|
|
||||||
//多选框选中数据
|
//多选框选中数据
|
||||||
function handleSelectionChange() {
|
function handleSelectionChange() {
|
||||||
|
single.value = selection.length != 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询字典大类
|
//查询字典大类
|
||||||
@ -216,7 +241,9 @@ function cancel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getTypeList()
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -227,17 +254,12 @@ function cancel() {
|
|||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="4" :xs="24">
|
<el-col :span="4" :xs="24">
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-input v-model="zdlbmc" clearable placeholder="请输入字典名称" prefix-icon="Search" style="margin-bottom: 20px"
|
<el-input v-model="zdlbmc" clearable placeholder="请输入字典名称" prefix-icon="Search" style="margin-bottom: 20px" />
|
||||||
@keyup.enter="handleQueryDetail" @clear="handleQueryDetail" />
|
|
||||||
</div>
|
</div>
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<p class="clickable" v-for="item in typeList" :key="item.zdlb" @click="refreshDetail(item.zddh)">{{
|
<el-tree ref="treeRef" class="filter-tree" :data="typeList" :props="defaultProps" default-expand-all
|
||||||
item.zdmc }}</p>
|
:filter-node-method="filterNode" @node-click="nodeHandle" highlight-current />
|
||||||
</div>
|
|
||||||
<div class="card-content">
|
|
||||||
<p class="clickable" v-for="item in typeList" :key="item.zdlb" @click="refreshDetail(item.zddh)">{{
|
|
||||||
item.zdmc }}</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -282,7 +304,7 @@ function cancel() {
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<!-- 表格区域-->
|
<!-- 表格区域-->
|
||||||
<el-table v-loading="loading" :data="typeDetail" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="typeDetail" @selection-change="handleSelectionChange" height="65vh">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label='字典类型' align="center" prop="zdlb" :show-overflow-tooltip="true" />
|
<el-table-column label='字典类型' align="center" prop="zdlb" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="明细代号" align="center" prop="zddh" />
|
<el-table-column label="明细代号" align="center" prop="zddh" />
|
||||||
@ -375,4 +397,9 @@ function cancel() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.filter-tree {
|
||||||
|
max-height: 70vh;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Loading…
x
Reference in New Issue
Block a user