Compare commits
2 Commits
43b068f3f6
...
d99aa6377d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d99aa6377d | ||
|
|
3e1168e794 |
12
src/api/liswork/xtwh/ReportSetting.ts
Normal file
12
src/api/liswork/xtwh/ReportSetting.ts
Normal file
@ -0,0 +1,12 @@
|
||||
//报告单设置界面
|
||||
// @ts-ignore
|
||||
import request from '@/utils/request'
|
||||
|
||||
//新增数据
|
||||
export function addReportService(LabReportInstr: Object){
|
||||
return request({
|
||||
url: '/labReportinstr/add',
|
||||
method: 'post',
|
||||
data: LabReportInstr
|
||||
})
|
||||
}
|
||||
9
src/types/Object.d.ts
vendored
Normal file
9
src/types/Object.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
export interface LabReportInstr {
|
||||
yq: string; //仪器
|
||||
xh: number; //序号
|
||||
bgdh: string; //报告单号
|
||||
yljg: string; //医疗机构
|
||||
type: string; //使用类型
|
||||
condition: string; //使用条件
|
||||
status?: string; //状态
|
||||
}
|
||||
4
src/types/index.d.ts
vendored
Normal file
4
src/types/index.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
//聚合文件,导出所有的类型定义
|
||||
|
||||
//对象文件
|
||||
export * from './Object';
|
||||
83
src/views/liswork/xtwh/reportsetting/index.vue
Normal file
83
src/views/liswork/xtwh/reportsetting/index.vue
Normal file
@ -0,0 +1,83 @@
|
||||
<template>
|
||||
<!--报告单设定-->
|
||||
<el-form ref="form" :model="formData" :rules="rules" label-width="80px">
|
||||
<el-form-item label="仪器" prop="yq">
|
||||
<el-input placeholder="仪器" v-model="formData.yq" style="width: 200px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handAdd">新增</el-button>
|
||||
<el-button type="primary" @click="handDelete">删除</el-button>
|
||||
<el-button type="primary" @click="handSave">保存</el-button>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<el-table :data="tableData" border width="100%" height="700px" @current-change="currentChange">
|
||||
<el-table-column label="仪器" prop="yq" align="center"></el-table-column>
|
||||
<el-table-column label="序号" prop="xh" align="center"></el-table-column>
|
||||
<el-table-column label="报告单号" prop="bgdh" align="center"></el-table-column>
|
||||
<el-table-column label="医疗机构" prop="yljg" align="center"></el-table-column>
|
||||
<el-table-column label="使用类型" prop="type" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-select v-model="row.type" placeholder="请选择" style="width: 120px;">
|
||||
<el-option label="默认" value="1"></el-option>
|
||||
<el-option label="参数" value="2"></el-option>
|
||||
<el-option label="根据项目来判断" value="3"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="使用条件" prop="condition" align="center"></el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref} from 'vue';
|
||||
import {addReportService} from '@/api/liswork/xtwh/ReportSetting';
|
||||
import { LabReportInstr } from '@/types/Index';
|
||||
|
||||
|
||||
|
||||
const formData = ref({
|
||||
yq: ''
|
||||
});
|
||||
|
||||
const rules = ref({
|
||||
// name: [
|
||||
// { required: true, message: '请输入姓名', trigger: 'blur' },
|
||||
// { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
|
||||
// ],
|
||||
// sex: [
|
||||
// { required: true, message: '请选择性别', trigger: 'blur' }
|
||||
// ]
|
||||
});
|
||||
|
||||
const tableData = ref<LabReportInstr[]>([]);
|
||||
|
||||
const handAdd = () => {
|
||||
const newReport: LabReportInstr = {
|
||||
yq: formData.value.yq,
|
||||
xh: tableData.value.length + 1,
|
||||
bgdh: '',
|
||||
yljg: '1',
|
||||
type: '1',
|
||||
condition: '',
|
||||
status: 'new'
|
||||
};
|
||||
tableData.value.push(newReport);
|
||||
};
|
||||
|
||||
const handDelete = () => {
|
||||
console.log('删除');
|
||||
};
|
||||
|
||||
const handSave = () => {
|
||||
//过滤数据,只需要新增的数据
|
||||
const newReports = tableData.value.filter(item => item.status === 'new');
|
||||
addReportService(newReports);
|
||||
};
|
||||
|
||||
|
||||
const currentChange = (currentRow: LabReportInstr, oldCurrentRow: LabReportInstr) => {
|
||||
console.log('当前行数据:', currentRow);
|
||||
};
|
||||
|
||||
</script>
|
||||
@ -40,8 +40,8 @@ export default defineConfig(({
|
||||
proxy: {
|
||||
// https://cn.vitejs.dev/config/#server-proxy
|
||||
'/dev-api': {
|
||||
//target: 'http://localhost:9801',
|
||||
target: 'http://47.97.125.165:8904',
|
||||
target: 'http://localhost:9801',
|
||||
//target: 'http://47.97.125.165:8904',
|
||||
// target: 'http://192.168.1.114:9801',
|
||||
changeOrigin: true,
|
||||
rewrite: (p) => p.replace(/^\/dev-api/, '')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user