From 7de165ce3fc2318681ed66494fb6da9fd700417b Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 12 九月 2025 10:22:23 +0800
Subject: [PATCH] 供应商往来页面接口修改
---
src/pages/cooperativeOffice/clientVisit/detail.vue | 74 ++++++++++++++++++------------------
1 files changed, 37 insertions(+), 37 deletions(-)
diff --git a/src/pages/cooperativeOffice/clientVisit/detail.vue b/src/pages/cooperativeOffice/clientVisit/detail.vue
index d429a6b..9c0460e 100644
--- a/src/pages/cooperativeOffice/clientVisit/detail.vue
+++ b/src/pages/cooperativeOffice/clientVisit/detail.vue
@@ -2,55 +2,57 @@
<view class="client-visit-detail">
<PageHeader title="瀹㈡埛鎷滆璇︽儏" @back="goBack" />
- <u-form @submit="handleSignIn" ref="formRef" label-width="110" input-align="right" error-message-align="right">
+ <u-form @submit="handleSignIn" ref="formRef" label-width="90">
<!-- 瀹㈡埛淇℃伅 -->
<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-form-item label="鑱旂郴浜�" prop="contact" border-bottom>
<u-input
- v-model="form.contactPerson"
+ v-model="form.contact"
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>
<!-- 鎷滆淇℃伅 -->
<u-cell-group title="鎷滆淇℃伅">
- <u-form-item label="鎷滆鐩殑" prop="visitPurpose" required border-bottom>
+ <u-form-item label="鎷滆鐩殑" prop="purposeVisit" required border-bottom>
<u-input
- v-model="form.visitPurpose"
+ v-model="form.purposeVisit"
placeholder="璇疯緭鍏ユ嫓璁跨洰鐨�"
/>
</u-form-item>
- <u-form-item label="鎷滆鏃堕棿" prop="visitTime" required border-bottom>
+ <u-form-item label="鎷滆鏃堕棿" prop="purposeDate" required border-bottom>
<u-input
- v-model="form.visitTime"
+ v-model="form.purposeDate"
placeholder="璇烽�夋嫨鎷滆鏃堕棿"
- readonly
@click="showTimePicker"
/>
+ <template #right>
+ <up-icon
+ name="arrow-right"
+ @click="showTimePicker"
+ ></up-icon>
+ </template>
</u-form-item>
- <u-form-item label="鎷滆鍦扮偣" prop="visitLocation" required border-bottom>
+ <u-form-item label="鎷滆鍦扮偣" prop="visitAddress" required border-bottom>
<u-input
- v-model="form.visitLocation"
+ v-model="form.visitAddress"
placeholder="璇疯緭鍏ユ嫓璁垮湴鐐�"
>
<template #suffix>
- <u-icon name="map" @click.stop="getCurrentLocation" class="location-icon" />
+ <u-icon name="map" @click="getCurrentLocation" class="location-icon" />
</template>
</u-input>
</u-form-item>
@@ -77,19 +79,19 @@
</u-form>
<!-- 鏃堕棿閫夋嫨鍣� -->
- <u-popup v-model="showTime" mode="bottom">
- <u-datetime-picker
- v-model="currentTime"
- title="閫夋嫨鏃堕棿"
- @confirm="onTimeConfirm"
- @cancel="showTime = false"
- />
- </u-popup>
+ <up-datetime-picker
+ :show="showTime"
+ v-model="currentTime"
+ @confirm="onTimeConfirm"
+ @cancel="showTime = false"
+ mode="datetime"
+ />
</view>
</template>
<script setup>
// 鏇挎崲 toast 鏂规硶
+defineOptions({name: 'client-visit-detail'})
const showToast = (message) => {
uni.showToast({
title: message,
@@ -98,7 +100,6 @@
}
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"
@@ -126,11 +127,13 @@
const formRef = ref(null)
// 鏃堕棿鐩稿叧
-const currentTime = ref(new Date())
+const currentTime = ref(Date.now())
const showTime = ref(false)
// 杩斿洖涓婁竴椤�
const goBack = () => {
+ // 杩斿洖鏃舵竻闄ゆ湰鍦板瓨鍌ㄧ殑ID
+ uni.removeStorageSync('clientVisit')
uni.navigateBack()
}
@@ -140,10 +143,11 @@
}
// 纭鏃堕棿閫夋嫨
-const onTimeConfirm = ({ selectedValues }) => {
- form.value.purposeDate = selectedValues.join('-')
- currentTime.value = selectedValues.join('-')
- showTime.value = false
+const onTimeConfirm = (e) => {
+ console.log(e)
+ form.value.purposeDate = dayjs(e.value).format('YYYY-MM-DD HH:mm:ss')
+ currentTime.value = e.value
+ showTime.value = false;
}
// 鑾峰彇褰撳墠浣嶇疆
@@ -207,8 +211,6 @@
// 鎻愪氦绛惧埌
const handleSignIn = async () => {
- console.log('form.value----', form.value);
-
if (!form.value.customerName) {
showToast('璇疯緭鍏ュ鎴峰悕绉�')
return
@@ -237,16 +239,14 @@
Object.keys(source).forEach((k) => {
submitData[k] = source[k]
})
-
- console.log('鎻愪氦鏁版嵁:', submitData)
-
+ console.log('submitData', submitData)
+
const { code } = await clientVisitSignIn(submitData)
- console.log('code----', code);
if (code === 200) {
showToast('绛惧埌鎴愬姛')
setTimeout(() => {
- uni.navigateBack()
+ goBack()
}, 500)
} else {
loading.value = false
@@ -254,7 +254,6 @@
}
} catch (e) {
loading.value = false
- showToast('绛惧埌澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�')
console.error('绛惧埌澶辫触:', e)
}
}
@@ -263,7 +262,7 @@
const initPageData = () => {
// 璁剧疆榛樿鎷滆鏃堕棿涓哄綋鍓嶆椂闂�
form.value.purposeDate = dayjs().format('YYYY-MM-DD HH:mm:ss')
- currentTime.value = new Date()
+ currentTime.value = Date.now()
// 璁剧疆鎷滆浜轰负褰撳墠鐧诲綍鐢ㄦ埛鐨勬樀绉�
form.value.visitingPeople = userStore.nickName || ''
@@ -275,6 +274,7 @@
</script>
<style scoped lang="scss">
+@import '@/static/scss/form-common.scss';
.client-visit {
min-height: 100vh;
background: #f8f9fa;
--
Gitblit v1.9.3