fix: 功能完善。

This commit is contained in:
tianyongbao
2024-12-13 09:25:45 +08:00
parent 949d0548d6
commit a82589e0e0
3 changed files with 56 additions and 1 deletions

View File

@@ -25,6 +25,11 @@
<u--input v-model="form.hospitalName" placeholder="请填写医院名称"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="就医类型" prop="typeName" required @click="handleType">
<u--input v-model="form.typeName" disabled disabledColor="#ffffff" placeholder="请选择就医类型"
inputAlign="right" border="none"></u--input>
<u-icon slot="right" name="arrow-down"></u-icon>
</u-form-item>
<u-form-item label="科室" prop="departments" required >
<u--input v-model="form.departments" placeholder="请填写科室"
inputAlign="right" border="none"></u--input>
@@ -73,6 +78,8 @@
@confirm="handlePersonConfirm"></u-picker>
<u-picker itemHeight="88" :show="showHealthRecord" :columns="healthRecordList" keyName="name" @cancel="handHealthRecordCancel"
@confirm="handHealthRecordConfirm"></u-picker>
<u-picker itemHeight="88" :show="showType" :columns="typeList" keyName="dictLabel" @cancel="handleTypeCancel"
@confirm="handleTypeConfirm"></u-picker>
<u-datetime-picker
:show="datePickShow"
mode="datetime"
@@ -100,6 +107,9 @@ const showHealthRecord = ref(false)
const title = ref("就医记录")
const healthRecordList = ref([])
const personList = ref([])
const typeList = ref([])
const showType = ref(false)
const data = reactive({
form: {
id: null,
@@ -139,6 +149,7 @@ rules: {
totalCost: [{ type: 'number', required: true, message: '总费用不能为空', trigger: ['change', 'blur'] }],
partner: [{ required: true, message: '陪同人不能为空', trigger: ['change', 'blur'] }],
prescribe: [{ required: true, message: '诊断及开药不能为空', trigger: ['change', 'blur'] }],
typeName: [{ required: true, message: '就医类型不能为空', trigger: ['change', 'blur'] }],
visitingTime: [{ required: true, message: '就诊时间不能为空', trigger: ['change', 'blur'] }]
}
})
@@ -167,6 +178,10 @@ function dictStr(val, arr) {
return str
}
function getData() {
// 就医类型
getDicts('doctor_type').then(res => {
typeList.value =[res.data]
})
listPerson(queryPersonParams.value).then((response) => {
personList.value = [response.rows]
if(response.rows.length>0){
@@ -188,6 +203,10 @@ function getData() {
getDoctorRecord(form.value.id).then(res => {
form.value = res.data
})
// 就医类型
getDicts('doctor_type').then(result => {
form.value.typeName=dictStr(form.value.type, result.data)
})
}
}
@@ -238,6 +257,23 @@ function handHealthRecordCancel() {
showHealthRecord.value = false
}
function handleType() {
if (typeList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '就医类型为空 ', type: 'warning'
})
} else {
showType.value = true
}
}
function handleTypeConfirm(e) {
form.value.typeName = e.value[0].dictLabel
form.value.type = e.value[0].dictValue
showType.value = false
}
function handleTypeCancel() {
showType.value = false
}
function selectDate() {
datePickShow.value = true

View File

@@ -74,6 +74,10 @@
<u--text lines="1" iconStyle="font-size: 18px; color: #333333; font-weight:bold"
:text="item.healthRecordName +''+ item.hospitalName" size="30rpx" color="#333333" :bold="true"></u--text>
</view>
<view class="item-row">
<text class="row-label">就医类型</text>
<text class="row-value">{{ dictStr(item.type, typeList) }}</text>
</view>
<view class="item-row">
<text class="row-label">就诊时间</text>
<text class="row-value">{{ item.visitingTime }}</text>
@@ -147,6 +151,8 @@ const timeShow= ref(false)
const showPerson = ref(false)
const personList = ref([])
const typeList = ref([])
const flag= ref(true)
const time =ref( Number(new Date()))
const data = reactive({
@@ -185,6 +191,15 @@ onLoad(() => {
timeShow.value = !timeShow.value
flag.value = data
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
function loadmore() {
pageNum.value += 1
if (status.value == 'loadmore') {
@@ -192,6 +207,10 @@ function loadmore() {
}
}
function getList() {
// 类型
getDicts('doctor_type').then(res => {
typeList.value = res.data
})
listPerson(queryPersonParams.value).then((response) => {
personList.value = [response.rows]
})

View File

@@ -93,7 +93,7 @@ async function handleLogin() {
} else if (loginForm.value.code === "" && captchaEnabled.value) {
modal.msgError("请输入验证码")
} else {
modal.loading("登录中,请耐心等待...")
modal.loading("登录中,请等待...")
pwdLogin()
}
};