修改文字
This commit is contained in:
parent
4117fee0f4
commit
81d8f62a18
|
|
@ -36,7 +36,7 @@
|
|||
<a-tree class="draggable-tree" draggable block-node :tree-data="treeData" >
|
||||
<template #title="{ data,title }">
|
||||
<div @mouseenter="data.showContent = true" @mouseleave="data.showContent = false">
|
||||
<span>{{title}}</span>
|
||||
<span @click="handleSearch(data)">{{title}}</span>
|
||||
<span v-if="data?.izEnabled == '1'" style="color:red;">(已停用)</span>
|
||||
<span v-show="data.showContent" style="margin-left: 5px;">
|
||||
<!-- 下拉菜单 -->
|
||||
|
|
@ -73,15 +73,6 @@
|
|||
<div style="width: calc(100% - 300px);float: left;">
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" >
|
||||
<!--插槽:table标题-->
|
||||
<!-- <template #tableTitle>
|
||||
<a-button type="primary" v-auth="'ConfigMaterial:config_material_category:add'" @click="handleCategoryAdd" preIcon="ant-design:plus-outlined"> 一级分类</a-button>
|
||||
<a-button type="primary" v-auth="'ConfigMaterial:config_material_type:add'" @click="handleTypeAdd" preIcon="ant-design:plus-outlined"> 二级分类</a-button>
|
||||
<a-button type="primary" v-auth="'ConfigMaterial:config_material_medication:add'" @click="handleMedicationAdd" preIcon="ant-design:plus-outlined"> 用药类型</a-button>
|
||||
</template> -->
|
||||
<!--字段回显插槽-->
|
||||
<!-- <template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template> -->
|
||||
</BasicTable>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -172,17 +163,33 @@ const menuState = reactive<Record<string, { timer?: number, openedByClick: boole
|
|||
})
|
||||
const labelCol = reactive({
|
||||
xs:24,
|
||||
sm:6,
|
||||
xl:6,
|
||||
xxl:6
|
||||
sm:8,
|
||||
xl:8,
|
||||
xxl:8
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 18,
|
||||
sm: 16,
|
||||
});
|
||||
|
||||
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
||||
|
||||
function handleSearch(data){
|
||||
var levle = parseInt(data.levle)
|
||||
if(levle == 1){
|
||||
queryParam.categoryId = data.key
|
||||
queryParam.typeId = ''
|
||||
queryParam.medicationId = ''
|
||||
}else if(levle == 2){
|
||||
queryParam.categoryId = data.categoryId
|
||||
queryParam.typeId = data.key
|
||||
queryParam.medicationId = ''
|
||||
}else if(levle == 3){
|
||||
queryParam.categoryId = data.categoryId
|
||||
queryParam.typeId = data.typeId
|
||||
queryParam.medicationId = data.key
|
||||
}
|
||||
reload();
|
||||
}
|
||||
//添加本级(只添加一级分类)
|
||||
function handleAddbj(data){
|
||||
// var params = {id:data.key,level:1,title:data.title}
|
||||
|
|
@ -204,17 +211,20 @@ const menuState = reactive<Record<string, { timer?: number, openedByClick: boole
|
|||
}
|
||||
//编辑
|
||||
function handleEdit(data){
|
||||
console.log("🚀 ~ handleEdit ~ data:", data)
|
||||
const params = {id:data.key,categoryId:data.categoryId,typeId:data.typeId,}
|
||||
if(data.levle == 1){
|
||||
params.categoryName = data.title
|
||||
registerTypeDrawer.value.disableSubmit = false;
|
||||
registerTypeDrawer.value.edit(params);
|
||||
registerDrawer.value.disableSubmit = false;
|
||||
registerDrawer.value.edit(params);
|
||||
}else if(data.levle == 2){
|
||||
params.categoryName = data.title
|
||||
params.typeName = data.title
|
||||
console.log("🚀 ~ handleEdit ~ params:", params)
|
||||
registerTypeDrawer.value.disableSubmit = false;
|
||||
registerTypeDrawer.value.edit(params);
|
||||
}else if(data.levle == 3){
|
||||
params.medicationName = data.title
|
||||
console.log("🚀 ~ handleEdit ~ params:", params)
|
||||
registerMedicationDrawer.value.disableSubmit = false;
|
||||
registerMedicationDrawer.value.edit(params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { getWeekMonthQuarterYear } from '/@/utils';
|
|||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '物料类别名称',
|
||||
title: '一级分类',
|
||||
align:"center",
|
||||
dataIndex: 'categoryName'
|
||||
},
|
||||
|
|
@ -19,7 +19,7 @@ export const columns: BasicColumn[] = [
|
|||
|
||||
export const allColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '一级分类名称',
|
||||
title: '一级分类',
|
||||
align:"center",
|
||||
dataIndex: 'categoryName',
|
||||
// customCell: (record, index, column) => {
|
||||
|
|
@ -29,7 +29,7 @@ export const allColumns: BasicColumn[] = [
|
|||
// },
|
||||
},
|
||||
{
|
||||
title: '二级分类名称',
|
||||
title: '二级分类',
|
||||
align:"center",
|
||||
dataIndex: 'typeName',
|
||||
// customCell: (record, index, column) => {
|
||||
|
|
@ -39,7 +39,7 @@ export const allColumns: BasicColumn[] = [
|
|||
// },
|
||||
},
|
||||
{
|
||||
title: '三级分类名称',
|
||||
title: '三级分类',
|
||||
align:"center",
|
||||
dataIndex: 'medicationName'
|
||||
},
|
||||
|
|
@ -50,12 +50,12 @@ export const searchFormSchema: FormSchema[] = [
|
|||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '物料类别名称',
|
||||
label: '一级分类',
|
||||
field: 'categoryName',
|
||||
component: 'Input',
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入物料类别名称!'},
|
||||
{ required: true, message: '请输入一级分类!'},
|
||||
];
|
||||
},
|
||||
},
|
||||
|
|
@ -79,7 +79,7 @@ export const formSchema: FormSchema[] = [
|
|||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
categoryName: {title: '物料类别名称',order: 0,view: 'text', type: 'string',},
|
||||
categoryName: {title: '一级分类',order: 0,view: 'text', type: 'string',},
|
||||
izEnabled: {title: '是否启用',order: 1,view: 'radio', type: 'string',dictCode: 'iz_enabled',},
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
<a-row :gutter="24">
|
||||
<a-col :lg="12">
|
||||
<a-form-item name="categoryName">
|
||||
<template #label><span title="物料类别">物料类别</span></template>
|
||||
<a-input placeholder="请输入物料类别" v-model:value="queryParam.categoryName" allow-clear ></a-input>
|
||||
<template #label><span title="一级分类">一级分类</span></template>
|
||||
<a-input placeholder="请输入一级分类" v-model:value="queryParam.categoryName" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12">
|
||||
|
|
@ -78,7 +78,7 @@
|
|||
//注册table数据
|
||||
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
|
||||
tableProps:{
|
||||
title: '物料类别',
|
||||
title: '一级分类',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:false,
|
||||
|
|
@ -102,7 +102,7 @@
|
|||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name:"物料类别",
|
||||
name:"一级分类",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -46,19 +46,19 @@ export const columns: BasicColumn[] = [
|
|||
width:'200px'
|
||||
},
|
||||
{
|
||||
title: '物料类别',
|
||||
title: '一级分类',
|
||||
align: "center",
|
||||
dataIndex: 'categoryId_dictText',
|
||||
width:'100px'
|
||||
},
|
||||
{
|
||||
title: '物料类型',
|
||||
title: '二级分类',
|
||||
align: "center",
|
||||
dataIndex: 'typeId_dictText',
|
||||
width:'100px'
|
||||
},
|
||||
{
|
||||
title: '用药类型',
|
||||
title: '三级分类',
|
||||
align: "center",
|
||||
dataIndex: 'medicationId_dictText',
|
||||
width:'100px'
|
||||
|
|
@ -85,9 +85,9 @@ export const columns: BasicColumn[] = [
|
|||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
categoryId: {title: '物料类别',order: 0,view: 'radio', type: 'string',dictTable: "nu_config_material_category", dictCode: 'id', dictText: 'category_name',},
|
||||
typeId: {title: '物料类型',order: 1,view: 'radio', type: 'string',dictTable: "nu_config_material_type", dictCode: 'id', dictText: 'type_name',},
|
||||
medicationId: {title: '用药类型',order: 2,view: 'radio', type: 'string',dictTable: "nu_config_material_medication", dictCode: 'id', dictText: 'medication_name',},
|
||||
categoryId: {title: '一级分类',order: 0,view: 'radio', type: 'string',dictTable: "nu_config_material_category", dictCode: 'id', dictText: 'category_name',},
|
||||
typeId: {title: '二级分类',order: 1,view: 'radio', type: 'string',dictTable: "nu_config_material_type", dictCode: 'id', dictText: 'type_name',},
|
||||
medicationId: {title: '三级分类',order: 2,view: 'radio', type: 'string',dictTable: "nu_config_material_medication", dictCode: 'id', dictText: 'medication_name',},
|
||||
materialName: {title: '货品名称',order: 3,view: 'text', type: 'string',},
|
||||
materialNo: {title: '货品编码',order: 4,view: 'text', type: 'string',},
|
||||
specificationModel: {title: '规格型号',order: 5,view: 'text', type: 'string',},
|
||||
|
|
|
|||
|
|
@ -6,20 +6,20 @@
|
|||
<a-row :gutter="24">
|
||||
<!-- <a-col :lg="6">
|
||||
<a-form-item name="categoryId">
|
||||
<template #label><span title="物料类别">物料类别</span></template>
|
||||
<j-dict-select-tag type='list' placeholder="请选择物料类别" v-model:value="queryParam.categoryId" dictCode="nu_config_material_category,category_name,id,iz_enabled = 0 and del_flag = 0" allow-clear />
|
||||
<template #label><span title="一级分类">一级分类</span></template>
|
||||
<j-dict-select-tag type='list' placeholder="请选择一级分类" v-model:value="queryParam.categoryId" dictCode="nu_config_material_category,category_name,id,iz_enabled = 0 and del_flag = 0" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="typeId">
|
||||
<template #label><span title="物料类型">物料类型</span></template>
|
||||
<j-dict-select-tag type='list' placeholder="请选择物料类型" v-model:value="queryParam.typeId" :dictCode="`nu_config_material_type,type_name,id,iz_enabled = 0 and del_flag = 0 and category_id = ${queryParam.categoryId || -1}`" allow-clear />
|
||||
<template #label><span title="二级分类">二级分类</span></template>
|
||||
<j-dict-select-tag type='list' placeholder="请选择二级分类" v-model:value="queryParam.typeId" :dictCode="`nu_config_material_type,type_name,id,iz_enabled = 0 and del_flag = 0 and category_id = ${queryParam.categoryId || -1}`" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="medicationId">
|
||||
<template #label><span title="用药类型">用药类型</span></template>
|
||||
<j-dict-select-tag type='list' placeholder="请选择用药类型" v-model:value="queryParam.medicationId" :dictCode="`config_material_medication,medication_name,id,iz_enabled = 0 and del_flag = 0 and type_id = ${queryParam.typeId || -1}`" allow-clear />
|
||||
<template #label><span title="三级分类">三级分类</span></template>
|
||||
<j-dict-select-tag type='list' placeholder="请选择三级分类" v-model:value="queryParam.medicationId" :dictCode="`config_material_medication,medication_name,id,iz_enabled = 0 and del_flag = 0 and type_id = ${queryParam.typeId || -1}`" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col> -->
|
||||
<a-col :lg="6">
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ import { getWeekMonthQuarterYear } from '/@/utils';
|
|||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '物料类别',
|
||||
title: '一级分类',
|
||||
align: "center",
|
||||
dataIndex: 'categoryId_dictText'
|
||||
},
|
||||
{
|
||||
title: '物料类型',
|
||||
title: '二级分类',
|
||||
align: "center",
|
||||
dataIndex: 'typeId_dictText'
|
||||
},
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@
|
|||
<a-row :gutter="24">
|
||||
<a-col :lg="12">
|
||||
<a-form-item name="categoryId">
|
||||
<template #label><span title="物料类别">物料类别</span></template>
|
||||
<j-dict-select-tag type='list' placeholder="请选择物料类别" v-model:value="queryParam.categoryId" dictCode="nu_config_material_category,category_name,id,iz_enabled = 0 and del_flag = 0" allow-clear />
|
||||
<template #label><span title="一级分类">一级分类</span></template>
|
||||
<j-dict-select-tag type='list' placeholder="请选择一级分类" v-model:value="queryParam.categoryId" dictCode="nu_config_material_category,category_name,id,iz_enabled = 0 and del_flag = 0" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12">
|
||||
<a-form-item name="typeId">
|
||||
<template #label><span title="物料类型">物料类型</span></template>
|
||||
<j-dict-select-tag type='list' placeholder="请选择物料类别" v-model:value="queryParam.typeId" :dictCode="`nu_config_material_type,type_name,id,iz_enabled = 0 and del_flag = 0 and category_id = ${queryParam.categoryId || -1}`" allow-clear />
|
||||
<template #label><span title="二级分类">二级分类</span></template>
|
||||
<j-dict-select-tag type='list' placeholder="请选择一级分类" v-model:value="queryParam.typeId" :dictCode="`nu_config_material_type,type_name,id,iz_enabled = 0 and del_flag = 0 and category_id = ${queryParam.categoryId || -1}`" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12">
|
||||
|
|
@ -79,7 +79,7 @@
|
|||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '物料用药类型',
|
||||
title: '三级分类',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:false,
|
||||
|
|
@ -93,7 +93,7 @@
|
|||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "物料用药类型",
|
||||
name: "三级分类",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ import { getWeekMonthQuarterYear } from '/@/utils';
|
|||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '物料类别',
|
||||
title: '一级分类',
|
||||
align: "center",
|
||||
dataIndex: 'categoryId_dictText'
|
||||
},
|
||||
{
|
||||
title: '物料类型',
|
||||
title: '二级分类',
|
||||
align: "center",
|
||||
dataIndex: 'typeName'
|
||||
},
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@
|
|||
<a-row :gutter="24">
|
||||
<a-col :lg="12">
|
||||
<a-form-item name="categoryId">
|
||||
<template #label><span title="物料类别">物料类别</span></template>
|
||||
<j-dict-select-tag type='list' placeholder="请选择物料类别" v-model:value="queryParam.categoryId" dictCode="nu_config_material_category,category_name,id,iz_enabled = 0 and del_flag = 0" allow-clear />
|
||||
<template #label><span title="一级分类">一级分类</span></template>
|
||||
<j-dict-select-tag type='list' placeholder="请选择一级分类" v-model:value="queryParam.categoryId" dictCode="nu_config_material_category,category_name,id,iz_enabled = 0 and del_flag = 0" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12">
|
||||
<a-form-item name="typeName">
|
||||
<template #label><span title="物料类型">物料类型</span></template>
|
||||
<a-input placeholder="请输入物料类型" v-model:value="queryParam.typeName" allow-clear ></a-input>
|
||||
<template #label><span title="二级分类">二级分类</span></template>
|
||||
<a-input placeholder="请输入二级分类" v-model:value="queryParam.typeName" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12">
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '物料类型',
|
||||
title: '二级分类',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:false,
|
||||
|
|
@ -87,7 +87,7 @@
|
|||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "物料类型",
|
||||
name: "二级分类",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@
|
|||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="ConfigMaterialMedicationForm">
|
||||
<a-row>
|
||||
<a-col :span="24" style="margin-top: 100px;">
|
||||
<a-form-item label="一级分类名称" v-bind="validateInfos.categoryName" id="ConfigMaterialMedicationForm-categoryName" name="categoryId">
|
||||
<a-input v-model:value="formData.categoryName" placeholder="请输入一级分类名称" allow-clear ></a-input>
|
||||
<a-form-item label="一级分类" v-bind="validateInfos.categoryName" id="ConfigMaterialMedicationForm-categoryName" name="categoryId">
|
||||
<a-input v-model:value="formData.categoryName" placeholder="请输入一级分类" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
const confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = reactive({
|
||||
categoryName: [{ required: true, message: '请输入一级分类名称', trigger: 'blur' }],
|
||||
categoryName: [{ required: true, message: '请输入一级分类', trigger: 'blur' }],
|
||||
});
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
|
||||
|
|
|
|||
|
|
@ -5,18 +5,18 @@
|
|||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="ConfigMaterialInfoForm">
|
||||
<a-row>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="物料类别" v-bind="validateInfos.categoryId" id="ConfigMaterialInfoForm-categoryId" name="categoryId">
|
||||
<j-dict-select-tag type='list' v-model:value="formData.categoryId" dictCode="nu_config_material_category,category_name,id,iz_enabled = 0 and del_flag = 0" placeholder="请选择物料类别" allow-clear @change="formData.typeId = null , formData.medicationId = null" />
|
||||
<a-form-item label="一级级分类" v-bind="validateInfos.categoryId" id="ConfigMaterialInfoForm-categoryId" name="categoryId">
|
||||
<j-dict-select-tag type='list' v-model:value="formData.categoryId" dictCode="nu_config_material_category,category_name,id,iz_enabled = 0 and del_flag = 0" placeholder="请选择一级级分类" allow-clear @change="formData.typeId = null , formData.medicationId = null" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="物料类型" v-bind="validateInfos.typeId" id="ConfigMaterialInfoForm-typeId" name="typeId">
|
||||
<j-dict-select-tag type='list' v-model:value="formData.typeId" :dictCode="`nu_config_material_type,type_name,id,category_id = ${formData.categoryId || -1} and iz_enabled = 0 and del_flag = 0 `" placeholder="请选择物料类型" @change="formData.medicationId = null" allow-clear />
|
||||
<a-form-item label="二级级分类" v-bind="validateInfos.typeId" id="ConfigMaterialInfoForm-typeId" name="typeId">
|
||||
<j-dict-select-tag type='list' v-model:value="formData.typeId" :dictCode="`nu_config_material_type,type_name,id,category_id = ${formData.categoryId || -1} and iz_enabled = 0 and del_flag = 0 `" placeholder="请选择二级级分类" @change="formData.medicationId = null" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="用药类型" v-bind="validateInfos.medicationId" id="ConfigMaterialInfoForm-medicationId" name="medicationId">
|
||||
<j-dict-select-tag type='list' v-model:value="formData.medicationId" :dictCode="`nu_config_material_medication,medication_name,id,type_id = ${formData.typeId || -1} and iz_enabled = 0 and del_flag = 0`" placeholder="请选择用药类型" allow-clear />
|
||||
<a-form-item label="三级级分类" v-bind="validateInfos.medicationId" id="ConfigMaterialInfoForm-medicationId" name="medicationId">
|
||||
<j-dict-select-tag type='list' v-model:value="formData.medicationId" :dictCode="`nu_config_material_medication,medication_name,id,type_id = ${formData.typeId || -1} and iz_enabled = 0 and del_flag = 0`" placeholder="请选择三级级分类" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
|
|
@ -106,7 +106,7 @@
|
|||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="供应商" v-bind="validateInfos.suppliers" id="ConfigMaterialInfoForm-suppliers" name="suppliers" :labelCol="labelCol3" :wrapperCol="wrapperCol3">
|
||||
<j-select-multiple placeholder="请选择物料类别" v-model:value="formData.suppliers" dictCode="nu_config_suppliers_info,suppliers_name,id,supply_state = 1 and del_flag = 0" allow-clear />
|
||||
<j-select-multiple placeholder="请选择一级级分类" v-model:value="formData.suppliers" dictCode="nu_config_suppliers_info,suppliers_name,id,supply_state = 1 and del_flag = 0" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
|
|
@ -182,8 +182,8 @@
|
|||
const confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = reactive({
|
||||
categoryId: [{ required: true, message: '请选择物料类别!'},],
|
||||
typeId: [{ required: true, message: '请选择物料类型!'},],
|
||||
categoryId: [{ required: true, message: '请选择一级级分类!'},],
|
||||
typeId: [{ required: true, message: '请选择二级级分类!'},],
|
||||
materialName: [{ required: true, message: '请输入货品名称!'},],
|
||||
salesUnitPrice: [{ required: true, message: '请输入销售单价!'},],
|
||||
referenceUnitPrice: [{ required: true, message: '请输入参考单价!'},],
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@
|
|||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="一级分类" v-bind="validateInfos.categoryId" id="ConfigMaterialMedicationForm-categoryId" name="categoryId">
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.categoryId" dictCode="nu_config_material_category,category_name,id,iz_enabled = 0 and del_flag = 0" placeholder="请选择一级分类" allow-clear />
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.categoryId" dictCode="nu_config_material_category,category_name,id,iz_enabled = 0 and del_flag = 0" placeholder="请选择一级分类" allow-clear v-if="showDictSelect"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="二级分类" v-bind="validateInfos.typeId" id="ConfigMaterialMedicationForm-typeId" name="typeId">
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.typeId" :dictCode="`nu_config_material_type,type_name,id,iz_enabled = 0 and del_flag = 0 and category_id = ${formData.categoryId || -1}`" placeholder="请选择二级分类" allow-clear />
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.typeId" :dictCode="`nu_config_material_type,type_name,id,iz_enabled = 0 and del_flag = 0 and category_id = ${formData.categoryId || -1}`" placeholder="请选择二级分类" allow-clear v-if="showDictSelect"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
|
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted,onUnmounted } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
|
|
@ -43,6 +43,7 @@
|
|||
const formRef = ref();
|
||||
const useForm = Form.useForm;
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
const showDictSelect = ref(false);
|
||||
const formData = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
categoryId: '',
|
||||
|
|
@ -85,8 +86,10 @@
|
|||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
showDictSelect.value = false;
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
showDictSelect.value = true;
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if(record.hasOwnProperty(key)){
|
||||
|
|
@ -95,6 +98,7 @@
|
|||
})
|
||||
//赋值
|
||||
Object.assign(formData, tmpData);
|
||||
formData.categoryId = record.categoryId;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -146,7 +150,9 @@
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
onUnmounted(() => {
|
||||
showDictSelect.value = false;
|
||||
});
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="一级分类" v-bind="validateInfos.categoryId" id="ConfigMaterialTypeForm-categoryId" name="categoryId">
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.categoryId" dictCode="nu_config_material_category,category_name,id,iz_enabled = 0 and del_flag = 0" placeholder="请选择一级分类" allow-clear />
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.categoryId" dictCode="nu_config_material_category,category_name,id,iz_enabled = 0 and del_flag = 0" placeholder="请选择一级分类" allow-clear v-if="showDictSelect"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
|
|
@ -38,6 +38,7 @@
|
|||
const formRef = ref();
|
||||
const useForm = Form.useForm;
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
const showDictSelect = ref(false);
|
||||
const formData = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
categoryId: '',
|
||||
|
|
@ -78,9 +79,11 @@
|
|||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
showDictSelect.value = false;
|
||||
console.log("🚀 ~ edit ~ record:", record)
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
showDictSelect.value = true;
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if(record.hasOwnProperty(key)){
|
||||
|
|
@ -90,6 +93,7 @@
|
|||
//赋值
|
||||
Object.assign(formData, tmpData);
|
||||
});
|
||||
console.log("🚀 ~ nextTick ~ formData:", formData)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -46,19 +46,19 @@ export const columns: BasicColumn[] = [
|
|||
width:'200px'
|
||||
},
|
||||
{
|
||||
title: '物料类别',
|
||||
title: '一级分类',
|
||||
align: "center",
|
||||
dataIndex: 'categoryId_dictText',
|
||||
width:'100px'
|
||||
},
|
||||
{
|
||||
title: '物料类型',
|
||||
title: '二级分类',
|
||||
align: "center",
|
||||
dataIndex: 'typeId_dictText',
|
||||
width:'100px'
|
||||
},
|
||||
{
|
||||
title: '用药类型',
|
||||
title: '三级分类',
|
||||
align: "center",
|
||||
dataIndex: 'medicationId_dictText',
|
||||
width:'100px'
|
||||
|
|
@ -85,9 +85,9 @@ export const columns: BasicColumn[] = [
|
|||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
categoryId: {title: '物料类别',order: 0,view: 'radio', type: 'string',dictTable: "nu_config_material_category", dictCode: 'id', dictText: 'category_name',},
|
||||
typeId: {title: '物料类型',order: 1,view: 'radio', type: 'string',dictTable: "nu_config_material_type", dictCode: 'id', dictText: 'type_name',},
|
||||
medicationId: {title: '用药类型',order: 2,view: 'radio', type: 'string',dictTable: "nu_config_material_medication", dictCode: 'id', dictText: 'medication_name',},
|
||||
categoryId: {title: '一级分类',order: 0,view: 'radio', type: 'string',dictTable: "nu_config_material_category", dictCode: 'id', dictText: 'category_name',},
|
||||
typeId: {title: '二级分类',order: 1,view: 'radio', type: 'string',dictTable: "nu_config_material_type", dictCode: 'id', dictText: 'type_name',},
|
||||
medicationId: {title: '三级分类',order: 2,view: 'radio', type: 'string',dictTable: "nu_config_material_medication", dictCode: 'id', dictText: 'medication_name',},
|
||||
materialName: {title: '货品名称',order: 3,view: 'text', type: 'string',},
|
||||
materialNo: {title: '货品编码',order: 4,view: 'text', type: 'string',},
|
||||
specificationModel: {title: '规格型号',order: 5,view: 'text', type: 'string',},
|
||||
|
|
|
|||
|
|
@ -119,8 +119,8 @@
|
|||
const dataList = ref<any>([]);
|
||||
//表单验证
|
||||
const validatorRules = reactive({
|
||||
categoryId: [{ required: true, message: '请选择物料类别!'},],
|
||||
typeId: [{ required: true, message: '请选择物料类型!'},],
|
||||
categoryId: [{ required: true, message: '请选择一级分类!'},],
|
||||
typeId: [{ required: true, message: '请选择二级分类!'},],
|
||||
materialName: [{ required: true, message: '请输入货品名称!'},],
|
||||
salesUnitPrice: [{ required: true, message: '请输入销售单价!'},],
|
||||
referenceUnitPrice: [{ required: true, message: '请输入参考单价!'},],
|
||||
|
|
|
|||
Loading…
Reference in New Issue