权限字符修改
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 查询区 -->
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入名称" clearable @keyup.enter="handleQuery" />
|
||||
@@ -9,17 +10,17 @@
|
||||
:props="{ value: 'id', label: 'name', children: 'children' }" value-key="id" placeholder="请选择"
|
||||
check-strictly />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 按钮区 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"
|
||||
v-hasPermi="['disease:disease:add']">新增</el-button>
|
||||
v-hasPermi="['biosafety:disease:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Sort" @click="toggleExpandAll">展开/折叠</el-button>
|
||||
@@ -27,6 +28,7 @@
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table v-if="refreshTable" v-loading="loading" :data="diseaseList" row-key="id"
|
||||
:default-expand-all="isExpandAll" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
|
||||
<el-table-column label="名称" prop="name" />
|
||||
@@ -34,32 +36,38 @@
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['disease:disease:edit']">修改</el-button>
|
||||
v-hasPermi="['biosafety:disease:edit']">修改</el-button>
|
||||
<el-button v-if="scope.row.pid === 0" link type="primary" icon="Plus" @click="handleAdd(scope.row)"
|
||||
v-hasPermi="['disease:disease:add']">
|
||||
新增
|
||||
</el-button>
|
||||
v-hasPermi="['biosafety:disease:add']">新增</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['disease:disease:remove']">删除</el-button>
|
||||
v-hasPermi="['biosafety:disease:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 添加或修改疾病对话框 -->
|
||||
<!-- 新增/修改弹窗 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="diseaseRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form ref="diseaseRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="desc">
|
||||
<el-input v-model="form.desc" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="pid">
|
||||
|
||||
<!-- 新增:是否为疾病大类 -->
|
||||
<el-form-item label="疾病大类" prop="isRoot">
|
||||
<el-switch v-model="form.isRoot" active-text="是" inactive-text="否" @change="onRootChange" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 父级选择(仅当 isRoot=false 时显示) -->
|
||||
<el-form-item v-if="!form.isRoot" label="上级疾病" prop="pid">
|
||||
<el-tree-select v-model="form.pid" :data="diseaseOptions"
|
||||
:props="{ value: 'id', label: 'name', children: 'children' }" value-key="id" placeholder="请选择"
|
||||
check-strictly />
|
||||
check-strictly clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
@@ -71,145 +79,143 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Disease">
|
||||
import { listDisease, getDisease, delDisease, addDisease, updateDisease } from "@/api/biosafety/disease"
|
||||
import { listDisease, getDisease, delDisease, addDisease, updateDisease } from '@/api/biosafety/disease'
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
/* 响应式数据 */
|
||||
const diseaseList = ref([])
|
||||
const diseaseOptions = ref([])
|
||||
const open = ref(false)
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
const title = ref("")
|
||||
const title = ref('')
|
||||
const isExpandAll = ref(true)
|
||||
const refreshTable = ref(true)
|
||||
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
form: {
|
||||
id: null,
|
||||
name: null,
|
||||
desc: null,
|
||||
pid: null,
|
||||
isRoot: true // 新增字段:true 表示作为根节点
|
||||
},
|
||||
queryParams: {
|
||||
name: null,
|
||||
desc: null,
|
||||
pid: null
|
||||
},
|
||||
rules: {
|
||||
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }]
|
||||
}
|
||||
})
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
|
||||
/** 查询疾病列表 */
|
||||
/* 事件函数 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listDisease(queryParams.value).then(response => {
|
||||
|
||||
diseaseList.value = proxy.handleTree(response.data, "id", "pid")
|
||||
listDisease(queryParams.value).then(res => {
|
||||
diseaseList.value = proxy.handleTree(res.data, 'id', 'pid')
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询疾病下拉树结构 */
|
||||
function getTreeselect() {
|
||||
listDisease().then(response => {
|
||||
diseaseOptions.value = response.data.filter(item => item.pid === 0)
|
||||
listDisease().then(res => {
|
||||
diseaseOptions.value = res.data.filter(item => item.pid === 0)
|
||||
})
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
name: null,
|
||||
desc: null,
|
||||
pid: null
|
||||
pid: null,
|
||||
isRoot: true
|
||||
}
|
||||
proxy.resetForm("diseaseRef")
|
||||
proxy.resetForm('diseaseRef')
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef")
|
||||
proxy.resetForm('queryRef')
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd(row) {
|
||||
reset()
|
||||
getTreeselect()
|
||||
if (row != null && row.id) {
|
||||
if (row && row.id) {
|
||||
form.value.pid = row.id
|
||||
form.value.isRoot = false
|
||||
} else {
|
||||
form.value.pid = 0
|
||||
form.value.isRoot = true
|
||||
}
|
||||
open.value = true
|
||||
title.value = "添加疾病"
|
||||
title.value = '添加疾病'
|
||||
}
|
||||
|
||||
/** 展开/折叠操作 */
|
||||
function toggleExpandAll() {
|
||||
refreshTable.value = false
|
||||
isExpandAll.value = !isExpandAll.value
|
||||
nextTick(() => {
|
||||
refreshTable.value = true
|
||||
})
|
||||
nextTick(() => (refreshTable.value = true))
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
async function handleUpdate(row) {
|
||||
reset()
|
||||
await getTreeselect()
|
||||
if (row != null) {
|
||||
form.value.pid = row.pid
|
||||
}
|
||||
getDisease(row.id).then(response => {
|
||||
form.value = response.data
|
||||
getDisease(row.id).then(res => {
|
||||
Object.assign(form.value, res.data)
|
||||
// 根据 pid 判断是否为根节点
|
||||
form.value.isRoot = !form.value.pid
|
||||
open.value = true
|
||||
title.value = "修改疾病"
|
||||
title.value = '修改疾病'
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function onRootChange(val) {
|
||||
// 切换时清空已选 pid
|
||||
if (val) form.value.pid = 0
|
||||
else form.value.pid = null
|
||||
}
|
||||
|
||||
function submitForm() {
|
||||
proxy.$refs["diseaseRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateDisease(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功")
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addDisease(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功")
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
proxy.$refs.diseaseRef.validate(valid => {
|
||||
if (!valid) return
|
||||
// 若作为根节点,强制 pid=0
|
||||
if (form.value.isRoot) form.value.pid = 0
|
||||
const api = form.value.id ? updateDisease : addDisease
|
||||
api(form.value).then(() => {
|
||||
proxy.$modal.msgSuccess(form.value.id ? '修改成功' : '新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
proxy.$modal.confirm('是否确认删除疾病' + row.name + '的数据项?').then(function () {
|
||||
return delDisease(row.id)
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => { })
|
||||
proxy.$modal.confirm(`是否确认删除疾病"${row.name}"的数据项?`)
|
||||
.then(() => delDisease(row.id))
|
||||
.then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess('删除成功')
|
||||
})
|
||||
.catch(() => { })
|
||||
}
|
||||
|
||||
/* 初始化 */
|
||||
getTreeselect()
|
||||
getList()
|
||||
</script>
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<!-- 3. 列表 -->
|
||||
<el-table v-loading="loading" :data="dewormList" @selection-change="handleSelectionChange" max-height="650px"
|
||||
@sort-change="handleSortChange">
|
||||
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="羊只耳号" align="center" prop="sheepNo" />
|
||||
<el-table-column label="品种" align="center" prop="variety" />
|
||||
<el-table-column label="羊只类别" align="center" prop="sheepType" />
|
||||
@@ -44,7 +44,6 @@
|
||||
<el-table-column label="繁殖状态" align="center" prop="breed" />
|
||||
|
||||
<el-table-column label="技术员" align="center" prop="technical" />
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="保健日期" align="center" prop="datetime" width="180">
|
||||
<template #default="scope">{{ parseTime(scope.row.datetime, '{y}-{m}-{d}') }}</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -26,15 +26,15 @@
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"
|
||||
v-hasPermi="['system:medicine:add']">新增</el-button>
|
||||
v-hasPermi="['biosafety:medicine:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['system:medicine:edit']">修改</el-button>
|
||||
v-hasPermi="['biosafety:medicine:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['system:medicine:remove']">删除</el-button>
|
||||
v-hasPermi="['biosafety:medicine:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" />
|
||||
</el-row>
|
||||
@@ -49,9 +49,9 @@
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:medicine:edit']">修改</el-button>
|
||||
v-hasPermi="['biosafety:medicine:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:medicine:remove']">删除</el-button>
|
||||
v-hasPermi="['biosafety:medicine:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -239,7 +239,7 @@ function handleDelete(row) {
|
||||
}
|
||||
|
||||
function handleExport() {
|
||||
proxy.download('system/medicine/export', { ...queryParams.value }, `药品_${new Date().getTime()}.xlsx`)
|
||||
proxy.download('biosafety/medicine/export', { ...queryParams.value }, `药品_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList()
|
||||
|
||||
@@ -45,13 +45,13 @@
|
||||
<!-- 按钮行 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"
|
||||
v-hasPermi="['bisosafety:quarantine:add']">新增</el-button>
|
||||
v-hasPermi="['biosafety:quarantine:add']">新增</el-button>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['bisosafety:quarantine:edit']">修改</el-button>
|
||||
v-hasPermi="['biosafety:quarantine:edit']">修改</el-button>
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['bisosafety:quarantine:remove']">删除</el-button>
|
||||
v-hasPermi="['biosafety:quarantine:remove']">删除</el-button>
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||
v-hasPermi="['bisosafety:quarantine:export']">导出</el-button>
|
||||
v-hasPermi="['biosafety:quarantine:export']">导出</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" />
|
||||
</el-row>
|
||||
|
||||
@@ -90,11 +90,11 @@
|
||||
<el-table-column label="操作" align="center" width="200" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['bisosafety:quarantine:edit']">检疫</el-button>
|
||||
v-hasPermi="['biosafety:quarantine:edit']">检疫</el-button>
|
||||
<el-button v-if="String(scope.row.result) === '1'" link type="success"
|
||||
@click="gotoTreatment(scope.row)">治疗</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['bisosafety:quarantine:remove']">删除</el-button>
|
||||
v-hasPermi="['biosafety:quarantine:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['variety:variety:add']"
|
||||
v-hasPermi="['base:variety:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@@ -32,7 +32,7 @@
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['variety:variety:edit']"
|
||||
v-hasPermi="['base:variety:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@@ -42,7 +42,7 @@
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['variety:variety:remove']"
|
||||
v-hasPermi="['base:variety:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@@ -51,7 +51,7 @@
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['variety:variety:export']"
|
||||
v-hasPermi="['base:variety:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
@@ -59,12 +59,12 @@
|
||||
|
||||
<el-table v-loading="loading" :data="varietyList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="${comment}" align="center" prop="id" />
|
||||
<el-table-column label="编号" align="center" prop="id" />
|
||||
<el-table-column label="品种" align="center" prop="variety" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['variety:variety:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['variety:variety:remove']">删除</el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['base:variety:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['base:variety:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -95,7 +95,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Variety">
|
||||
import { listVariety, getVariety, delVariety, addVariety, updateVariety } from "@/api/variety/variety"
|
||||
import { listVariety, getVariety, delVariety, addVariety, updateVariety } from "@/api/fileManagement/variety"
|
||||
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
@@ -219,7 +219,7 @@ function handleDelete(row) {
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('variety/variety/export', {
|
||||
proxy.download('base/variety/export', {
|
||||
...queryParams.value
|
||||
}, `variety_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['sperm:sperm:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['frozen:sperm:add']">新增</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
@@ -33,14 +33,14 @@
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['sperm:sperm:remove']">删除</el-button>
|
||||
v-hasPermi="['frozen:sperm:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||
v-hasPermi="['sperm:sperm:export']">导出</el-button>
|
||||
v-hasPermi="['frozen:sperm:export']">导出</el-button>
|
||||
</el-col>
|
||||
<el-button type="warning" plain icon="Close" @click="handleDiscard" :disabled="multiple"
|
||||
v-hasPermi="['sperm:sperm:discard']">废弃</el-button>
|
||||
v-hasPermi="['frozen:sperm:discard']">废弃</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<template #default="scope">
|
||||
<!-- <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['sperm:sperm:edit']">修改</el-button> -->
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['sperm:sperm:remove']">删除</el-button>
|
||||
v-hasPermi="['frozen:sperm:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
<script setup name="ChangeVariety">
|
||||
import { listChangeVariety, getChangeVariety, delChangeVariety, addChangeVariety, updateChangeVariety, getSheepByManageTags,searchEarNumbers } from "@/api/produce/manage_sheep/changeVariety"
|
||||
import { listSheepfold_management as listSheepfold } from '@/api/fileManagement/sheepfold_management'
|
||||
import { listVariety } from '@/api/variety/variety'
|
||||
import { listVariety } from '@/api/fileManagement/variety'
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user