From 7a0ffb0048adeda9ebfbca1d0b525eb224c173e3 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期五, 29 八月 2025 17:00:16 +0800 Subject: [PATCH] 修改组件 --- src/pages/cooperativeOffice/clientVisit/detail.vue | 179 +++++++++++++++++++++++++++-------------------------------- 1 files changed, 82 insertions(+), 97 deletions(-) diff --git a/src/pages/cooperativeOffice/clientVisit/detail.vue b/src/pages/cooperativeOffice/clientVisit/detail.vue index e22638a..d429a6b 100644 --- a/src/pages/cooperativeOffice/clientVisit/detail.vue +++ b/src/pages/cooperativeOffice/clientVisit/detail.vue @@ -1,122 +1,107 @@ <template> - <view class="client-visit"> - <!-- 浣跨敤閫氱敤椤甸潰澶撮儴缁勪欢 --> - <PageHeader title="瀹㈡埛鎷滆鐧昏" @back="goBack" /> + <view class="client-visit-detail"> + <PageHeader title="瀹㈡埛鎷滆璇︽儏" @back="goBack" /> - <!-- 绛惧埌琛ㄥ崟 --> - <van-form @submit="handleSignIn" ref="formRef" label-width="110px" input-align="right" error-message-align="right"> + <u-form @submit="handleSignIn" ref="formRef" label-width="110" input-align="right" error-message-align="right"> <!-- 瀹㈡埛淇℃伅 --> - <van-cell-group title="瀹㈡埛淇℃伅" inset> - <van-field - v-model="form.customerName" - label="瀹㈡埛鍚嶇О" - placeholder="璇疯緭鍏ュ鎴峰悕绉�" - required - name="customerName" - clearable - /> - <van-field - v-model="form.contact" - label="鑱旂郴浜�" - placeholder="璇疯緭鍏ヨ仈绯讳汉" - name="contact" - clearable - /> - <van-field - v-model="form.contactPhone" - label="鑱旂郴鐢佃瘽" - placeholder="璇疯緭鍏ヨ仈绯荤數璇�" - name="contactPhone" - clearable - /> - </van-cell-group> - + <u-cell-group title="瀹㈡埛淇℃伅"> + <u-form-item label="瀹㈡埛鍚嶇О" prop="customerName" required border-bottom> + <u-input + v-model="form.customerName" + placeholder="璇疯緭鍏ュ鎴峰悕绉�" + readonly + /> + </u-form-item> + <u-form-item label="鑱旂郴浜�" prop="contactPerson" border-bottom> + <u-input + v-model="form.contactPerson" + placeholder="璇疯緭鍏ヨ仈绯讳汉" + readonly + /> + </u-form-item> + <u-form-item label="鑱旂郴鐢佃瘽" prop="contactPhone" border-bottom> + <u-input + v-model="form.contactPhone" + placeholder="璇疯緭鍏ヨ仈绯荤數璇�" + readonly + /> + </u-form-item> + </u-cell-group> + <!-- 鎷滆淇℃伅 --> - <van-cell-group title="鎷滆淇℃伅" inset> - <van-field - v-model="form.visitingPeople" - label="鎷滆浜�" - placeholder="鎷滆浜�" - name="visitingPeople" - readonly - clearable - /> - <van-field - v-model="form.purposeVisit" - label="鎷滆鐩殑" - placeholder="璇疯緭鍏ユ嫓璁跨洰鐨�" - name="purposeVisit" - required - clearable - /> - <van-field - v-model="form.purposeDate" - label="鎷滆鏃堕棿" - placeholder="璇烽�夋嫨鎷滆鏃堕棿" - name="purposeDate" - required - readonly - @click="showTimePicker" - clearable - /> - <van-field - v-model="form.visitAddress" - label="褰撳墠浣嶇疆" - placeholder="鐐瑰嚮鑾峰彇褰撳墠浣嶇疆" - name="visitAddress" - :readonly="true" - :disabled="true" - type="textarea" - @click="getCurrentLocation" - clearable - > - <template #right-icon> - <van-icon name="location-o" @click.stop="getCurrentLocation" class="location-icon" /> - </template> - </van-field> - </van-cell-group> - + <u-cell-group title="鎷滆淇℃伅"> + <u-form-item label="鎷滆鐩殑" prop="visitPurpose" required border-bottom> + <u-input + v-model="form.visitPurpose" + placeholder="璇疯緭鍏ユ嫓璁跨洰鐨�" + /> + </u-form-item> + <u-form-item label="鎷滆鏃堕棿" prop="visitTime" required border-bottom> + <u-input + v-model="form.visitTime" + placeholder="璇烽�夋嫨鎷滆鏃堕棿" + readonly + @click="showTimePicker" + /> + </u-form-item> + <u-form-item label="鎷滆鍦扮偣" prop="visitLocation" required border-bottom> + <u-input + v-model="form.visitLocation" + placeholder="璇疯緭鍏ユ嫓璁垮湴鐐�" + > + <template #suffix> + <u-icon name="map" @click.stop="getCurrentLocation" class="location-icon" /> + </template> + </u-input> + </u-form-item> + </u-cell-group> + <!-- 澶囨敞淇℃伅 --> - <van-cell-group title="澶囨敞淇℃伅" inset> - <van-field - v-model="form.remark" - label="澶囨敞" - name="remark" - type="textarea" - placeholder="璇疯緭鍏ュ娉ㄤ俊鎭�" - rows="3" - autosize - clearable - /> - </van-cell-group> - + <u-cell-group title="澶囨敞淇℃伅"> + <u-form-item label="澶囨敞" prop="remark" border-bottom> + <u-textarea + v-model="form.remark" + placeholder="璇疯緭鍏ュ娉ㄤ俊鎭�" + :maxlength="200" + count + :autoHeight="true" + /> + </u-form-item> + </u-cell-group> + <!-- 鎻愪氦鎸夐挳 --> <view class="footer-btns"> - <van-button class="cancel-btn" @click="goBack">鍙栨秷</van-button> - <van-button class="sign-btn" native-type="submit" form-type="submit" :loading="loading">绛惧埌</van-button> + <u-button class="cancel-btn" @click="goBack">鍙栨秷</u-button> + <u-button class="sign-btn" type="primary" @click="handleSignIn" :loading="loading">绛惧埌</u-button> </view> - </van-form> - + </u-form> + <!-- 鏃堕棿閫夋嫨鍣� --> - <van-popup v-model:show="showTime" position="bottom"> - <van-date-picker + <u-popup v-model="showTime" mode="bottom"> + <u-datetime-picker v-model="currentTime" - type="datetime" + title="閫夋嫨鏃堕棿" @confirm="onTimeConfirm" @cancel="showTime = false" - title="閫夋嫨鎷滆鏃堕棿" /> - </van-popup> + </u-popup> </view> </template> <script setup> +// 鏇挎崲 toast 鏂规硶 +const showToast = (message) => { + uni.showToast({ + title: message, + icon: 'none' + }) +} + import { ref, onMounted } from 'vue' import { onShow } from '@dcloudio/uni-app' import PageHeader from '@/components/PageHeader.vue' import { clientVisitSignIn } from '@/api/cooperativeOffice/clientVisit' import useUserStore from "@/store/modules/user" -import { showToast } from 'vant' import dayjs from "dayjs" const userStore = useUserStore() -- Gitblit v1.9.3