9.4上午提交
This commit is contained in:
@@ -12,34 +12,79 @@
|
||||
/>
|
||||
<view class="form-block">
|
||||
<view class="label">备注</view>
|
||||
<input class="input" v-model.trim="remark" placeholder="给患者添加备注名" placeholder-class="ph" maxlength="20"/>
|
||||
<input class="input" v-model.trim="remark" :placeholder="groupInfo.nickname || '给患者添加备注名'" placeholder-class="ph" maxlength="20"/>
|
||||
</view>
|
||||
<view class="form-block">
|
||||
<view class="form-block" @click="goGroup">
|
||||
<view class="label">分组</view>
|
||||
<view class="iptbox">
|
||||
<input class="input" v-model.trim="remark" placeholder="通过分组给患者分类" placeholder-class="ph" maxlength="20" readonly/>
|
||||
<view class="iptbox readonly">
|
||||
<input class="input readonly-input" v-model.trim="groupName" :placeholder="groupInfo.name || '通过分组给患者分类'" placeholder-class="ph" maxlength="20" readonly disabled/>
|
||||
<uni-icons type="right" size="20" color="#666"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-block">
|
||||
<view class="label">描述</view>
|
||||
<textarea class="textarea" v-model.trim="note" placeholder="补充患者关键信息,方便随访患者" placeholder-class="ph" auto-height maxlength="140"/>
|
||||
<textarea class="textarea" v-model.trim="note" :placeholder="groupInfo.note || '补充患者关键信息,方便随访患者'" placeholder-class="ph" auto-height maxlength="140"/>
|
||||
</view>
|
||||
|
||||
<view class="bottom-bar">
|
||||
<button class="save-btn" @click="saveRemark">保存</button>
|
||||
<button class="save-btn" @click="updateNicknameNote">保存</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import api from '@/api/api.js'
|
||||
import navTo from '@/utils/navTo.js'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
const remark = ref('')
|
||||
const note = ref('')
|
||||
|
||||
const groupName = ref('')
|
||||
const patientUuid = ref('')
|
||||
const patientCardData = ref({})
|
||||
const groupInfo = ref({})
|
||||
|
||||
const goBack = () => {
|
||||
uni.navigateBack()
|
||||
}
|
||||
const goGroup = () => {
|
||||
navTo({
|
||||
url: `/pages_app/groupManage/groupManage?uuid=${patientUuid.value}`
|
||||
})
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
patientUuid.value = options.uuid || ''
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
patientCard()
|
||||
})
|
||||
const patientCard = () =>{
|
||||
api.patientCard({
|
||||
patient_uuid: patientUuid.value
|
||||
}).then(res => {
|
||||
if(res.code == 200){
|
||||
patientCardData.value = res
|
||||
groupInfo.value = res.group || {}
|
||||
// 初始化表单数据
|
||||
remark.value = res.group?.nickname || ''
|
||||
note.value = res.group?.note || ''
|
||||
groupName.value = res.group?.name || ''
|
||||
}
|
||||
})
|
||||
}
|
||||
const updateNicknameNote = async() => {
|
||||
const res = await api.updateNicknameNote({
|
||||
patient_uuid: patientUuid.value,
|
||||
nickname: remark.value,
|
||||
note: note.value,
|
||||
})
|
||||
if(res.code == 200){
|
||||
uni.showToast({ title: '保存成功', icon: 'none' })
|
||||
setTimeout(() => goBack(), 700)
|
||||
}
|
||||
}
|
||||
|
||||
const saveRemark = () => {
|
||||
if (!remark.value) {
|
||||
@@ -63,6 +108,10 @@
|
||||
background: #f8f8f8;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
&.readonly {
|
||||
background: #f5f5f5;
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
|
||||
background: #fff;
|
||||
@@ -79,6 +128,10 @@
|
||||
padding: 24rpx;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
&.readonly-input {
|
||||
background: transparent;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
.textarea{
|
||||
background: #f8f8f8;
|
||||
@@ -101,6 +154,9 @@
|
||||
padding: 20rpx 24rpx env(safe-area-inset-bottom);
|
||||
.save-btn{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 92rpx;
|
||||
background: #8B2316;
|
||||
color: #fff;
|
||||
|
||||
Reference in New Issue
Block a user