字典
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 { useRouter } from 'vue-router'
|
||||
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'
|
||||
const router = useRouter()
|
||||
const printStore = usePrintStore();
|
||||
@ -340,7 +340,7 @@ const goReport = () => {
|
||||
|
||||
onMounted(() => {
|
||||
adjustTableHeight();
|
||||
|
||||
getList()
|
||||
});
|
||||
|
||||
// 计算table高度
|
||||
@ -361,20 +361,31 @@ function adjustTableHeight() {
|
||||
|
||||
|
||||
|
||||
|
||||
// 生成条码
|
||||
const printHandle = () => {
|
||||
const url = 'http://47.97.125.165:8904/lis.pdf'
|
||||
HiprintPrinter.silentPrintPdf(
|
||||
url,
|
||||
{
|
||||
// 自定义打印参数(可选)
|
||||
orientation: "portrait", // 纵向(landscape=横向)
|
||||
copies: 1,
|
||||
monochrome: false, // 是否黑白打印
|
||||
},
|
||||
);
|
||||
const data = {
|
||||
dept: 123,
|
||||
userid: 'lis',
|
||||
st: '2025-01-01 00:00:00',
|
||||
et: '2025-05-21 23:59:59',
|
||||
yljg: 1
|
||||
}
|
||||
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 url = 'http://47.97.125.165:8904/lis.pdf'
|
||||
HiprintPrinter.silentPrintPdf(
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
<script setup>
|
||||
import { computed } from "vue";
|
||||
import { computed, reactive, ref, onMounted, nextTick } from "vue";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { queryComDictListService, addComDictService, updateComDictService } from "../../../api/liswork/dict/ComDict.js";
|
||||
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const data = reactive({
|
||||
@ -20,6 +21,7 @@ const data = reactive({
|
||||
dictType: [{ required: true, message: "字典类型不能为空", trigger: "blur" }]
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
@ -50,7 +52,33 @@ const upload = reactive({
|
||||
// 上传的地址
|
||||
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) {
|
||||
queryParams.value = {
|
||||
pageNum: 1,
|
||||
@ -61,7 +89,6 @@ function resetData(zdlb) {
|
||||
yljg: '1'
|
||||
}
|
||||
}
|
||||
|
||||
function getTypeList() {
|
||||
loading.value = true;
|
||||
queryParams.value.pageSize = 1000;
|
||||
@ -71,18 +98,17 @@ function getTypeList() {
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
resetData()
|
||||
queryParams.value.zdlb = response.rows[1].zddh
|
||||
getList()
|
||||
});
|
||||
}
|
||||
|
||||
function refreshDetail(zdlb) {
|
||||
queryParams.value.zdlb = zdlb;
|
||||
getList()
|
||||
resetData(zdlb)
|
||||
}
|
||||
|
||||
|
||||
/** 查询字典明细列表 */
|
||||
function getList() {
|
||||
|
||||
|
||||
loading.value = true;
|
||||
queryComDictListService(queryParams.value).then(response => {
|
||||
typeDetail.value = response.rows;
|
||||
@ -110,10 +136,8 @@ function reset() {
|
||||
}
|
||||
//重置
|
||||
function resetQuery() {
|
||||
queryParams.value = {
|
||||
zdmc: '',
|
||||
zddh: ''
|
||||
}
|
||||
queryParams.value.zdmc = ''
|
||||
queryParams.value.zddh = ''
|
||||
proxy.resetForm("queryRef");
|
||||
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() {
|
||||
|
||||
single.value = selection.length != 1;
|
||||
}
|
||||
|
||||
//查询字典大类
|
||||
@ -216,7 +241,9 @@ function cancel() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getTypeList()
|
||||
})
|
||||
|
||||
|
||||
|
||||
@ -227,17 +254,12 @@ function cancel() {
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4" :xs="24">
|
||||
<div class="head-container">
|
||||
<el-input v-model="zdlbmc" clearable placeholder="请输入字典名称" prefix-icon="Search" style="margin-bottom: 20px"
|
||||
@keyup.enter="handleQueryDetail" @clear="handleQueryDetail" />
|
||||
<el-input v-model="zdlbmc" clearable placeholder="请输入字典名称" prefix-icon="Search" style="margin-bottom: 20px" />
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<div class="card-content">
|
||||
<p class="clickable" v-for="item in typeList" :key="item.zdlb" @click="refreshDetail(item.zddh)">{{
|
||||
item.zdmc }}</p>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<p class="clickable" v-for="item in typeList" :key="item.zdlb" @click="refreshDetail(item.zddh)">{{
|
||||
item.zdmc }}</p>
|
||||
<el-tree ref="treeRef" class="filter-tree" :data="typeList" :props="defaultProps" default-expand-all
|
||||
:filter-node-method="filterNode" @node-click="nodeHandle" highlight-current />
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
@ -282,7 +304,7 @@ function cancel() {
|
||||
</el-col>
|
||||
</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 label='字典类型' align="center" prop="zdlb" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="明细代号" align="center" prop="zddh" />
|
||||
@ -375,4 +397,9 @@ function cancel() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.filter-tree {
|
||||
max-height: 70vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
Loading…
x
Reference in New Issue
Block a user