3.6修改

This commit is contained in:
zoujiandong
2026-03-06 19:01:31 +08:00
parent 89848ba321
commit 1fa822ed72
15 changed files with 360 additions and 78 deletions
+76 -4
View File
@@ -34,7 +34,7 @@
<view class="form-item">
<view class="label">地址 <text class="required">*</text></view>
<view class="value">
<input class="input" v-model.trim="form.location" placeholder="请输入地址" />
<input class="input" v-model.trim="form.location" placeholder="如门诊楼东侧502室" />
</view>
</view>
@@ -53,18 +53,71 @@
</view>
<view class="bottom-actions">
<view class="submit-btn" @click="submit">
<view class="submit-btn" @click="alertDialog">
<text class="btn-text">{{form.uuid?'确定修改':'确定新增'}}</text>
</view>
</view>
</view>
<unidialog
:visible="noticeVisible"
:title="'执业地点'"
:cancelText="'返回修改'"
:confirmText="'确认发布'"
@close="noticeVisible=false"
@confirm="noticeConfirm"
>
<template v-slot:content>
<view class="ppt-content">
<view class="notice-row">
<view class="name">医院</view>
<view class="value" v-if="reason==1">{{ form.hospital_name }}</view>
</view>
<view class="notice-row">
<view class="name">科室</view>
<view class="value">
{{ form.office_name }}
</view>
</view>
<view class="notice-row">
<view class="name">地址</view>
<view class="value">
{{ form.location }}
</view>
</view>
<view class="notice-row">
<view class="name">门诊类型</view>
<view class="value" v-if="form.type==1">
普通门诊
</view>
<view class="value" v-if="form.type==2">
专家门诊
</view>
<view class="value" v-if="form.type==3">
特需门诊
</view>
<view class="value" v-if="form.type==4">
专科/专病门诊
</view>
</view>
</view>
</template>
</unidialog>
</template>
<script setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import navBar from '@/components/navBar/navBar.vue'
import unidialog from '@/components/dialog/dialog.vue'
import api from '@/api/api.js'
const noticeVisible = ref(false)
const noticeConfirm = () => {
noticeVisible.value = false
submit()
}
const pageTitle = ref('新增执业地点')
const form = ref({
@@ -72,7 +125,7 @@ const form = ref({
hospital_name: '',
office_name: '',
location: '',
type: 4
type: 1
})
const selectType = (t) => { form.value.type = t }
@@ -111,9 +164,15 @@ const validate = () => {
return ''
}
const submit = async () => {
const alertDialog = () => {
const err = validate()
if (err) { uni.showToast({ title: err, icon: 'none' }); return }
noticeVisible.value = true
}
const submit = async () => {
// 示例更新接口;若不存在可替换为新增或本地处理
try {
const res =form.value.uuid?await api.updateWorkPlace(form.value) : await api.addWorkPlace(form.value)
@@ -146,6 +205,19 @@ onLoad((options) => {
</script>
<style lang="scss" scoped>
.notice-row{
display: flex;
align-items: center;
margin-bottom: 20rpx;
.name{
width: 160rpx;
text-align: right;
}
.value{
flex: 1;
text-align: left;
}
}
.edit-address-page { min-height: 100vh; background: #fff; }
.form-container { padding: 24rpx;margin-top: calc(var(--status-bar-height) + 44px); }