From ee42bf1badae06026efa79dc17d2a541297ab49b Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 03 九月 2025 17:43:31 +0800
Subject: [PATCH] 采购管理整体样式优化,搜索条件修改

---
 src/pages/sales/invoiceLedger/index.vue |  383 +++++++++++++++++-------------------------------------
 1 files changed, 120 insertions(+), 263 deletions(-)

diff --git a/src/pages/sales/invoiceLedger/index.vue b/src/pages/sales/invoiceLedger/index.vue
index cc7f81f..f4cf5c2 100644
--- a/src/pages/sales/invoiceLedger/index.vue
+++ b/src/pages/sales/invoiceLedger/index.vue
@@ -1,38 +1,31 @@
 <template>
 	<view class="sales-account">
-		<!-- 椤甸潰澶撮儴 -->
-		<van-nav-bar
-			title="寮�绁ㄥ彴璐�"
-			left-text="杩斿洖"
-			left-arrow
-			@click-left="goBack"
-			fixed
-			placeholder
-		/>
-
+		<!-- 浣跨敤閫氱敤椤甸潰澶撮儴缁勪欢 -->
+		<PageHeader title="寮�绁ㄥ彴璐�" @back="goBack" />
+		
 		<!-- 鎼滅储鍜岀瓫閫夊尯鍩燂紙淇濇寔涓庨攢鍞彴璐﹂鏍间竴鑷达級 -->
-		<view class="search-filter-section">
+		<view class="search-section">
 			<view class="search-bar">
 				<view class="search-input">
-					<input
+					<up-input
 						class="search-text"
-						placeholder="瀹㈡埛鍚嶇О/閿�鍞悎鍚屽彿"
+						placeholder="璇疯緭鍏ュ鎴峰悕绉�/鍚堝悓鍙锋悳绱�"
 						v-model="searchForm.searchText"
-						confirm-type="search"
-						@confirm="handleQuery"
+						@change="handleQuery"
+						clearable
 					/>
 				</view>
-<!--				<view class="filter-button" @click="showFilter = true">-->
-<!--					<up-icon name="list" size="24" color="#999"></up-icon>-->
-<!--				</view>-->
+				<!--				<view class="filter-button" @click="showFilter = true">-->
+				<!--					<up-icon name="list" size="24" color="#999"></up-icon>-->
+				<!--				</view>-->
 				<view class="filter-button" @click="handleQuery">
 					<up-icon name="search" size="24" color="#999"></up-icon>
 				</view>
 			</view>
 		</view>
-
+		
 		<!-- 鍒楄〃鍖哄煙 -->
-		<view class="ledger-list" v-if="total > 0">
+		<view class="ledger-list" v-if="ledgerList.length > 0">
 			<view v-for="(item, index) in ledgerList" :key="index">
 				<view class="ledger-item">
 					<view class="item-header">
@@ -91,7 +84,7 @@
 						</view>
 					</view>
 					<view class="action-buttons">
-						<van-button
+						<up-button
 							type="primary"
 							size="small"
 							class="action-btn"
@@ -99,36 +92,36 @@
 							@click="openEdit(item)"
 						>
 							缂栬緫
-						</van-button>
-						<van-button
-							type="danger"
+						</up-button>
+						<up-button
+							type="error"
 							size="small"
+							plain
 							class="action-btn"
 							:disabled="item.invoicePerson !== userStore.nickName"
 							@click="handleDelete(item)"
 						>
 							鍒犻櫎
-						</van-button>
-						<van-button
-							type="default"
-							size="small"
-							class="action-btn"
-							v-if="item.invoiceFileName"
-							@click="openFileActions(item.commonFiles || [])"
-						>
-							鏌ョ湅闄勪欢
-						</van-button>
-						<van-button
-							type="primary"
-							size="small"
-							plain
-							class="action-btn"
-							v-else
-							:disabled="item.invoicePerson !== userStore.nickName"
-							@click="openUpload(item)"
-						>
-							涓婁紶
-						</van-button>
+						</up-button>
+<!--						<up-button-->
+<!--							size="small"-->
+<!--							plain-->
+<!--							class="action-btn"-->
+<!--							v-if="item.invoiceFileName"-->
+<!--							@click="openFileActions(item.commonFiles || [])"-->
+<!--						>-->
+<!--							鏌ョ湅闄勪欢-->
+<!--						</up-button>-->
+<!--						<up-button-->
+<!--							type="primary"-->
+<!--							size="small"-->
+<!--							class="action-btn"-->
+<!--							v-else-->
+<!--							:disabled="item.invoicePerson !== userStore.nickName"-->
+<!--							@click="openUpload(item)"-->
+<!--						>-->
+<!--							涓婁紶-->
+<!--						</up-button>-->
 					</view>
 				</view>
 			</view>
@@ -136,107 +129,131 @@
 		<view v-else class="no-data">
 			<text>鏆傛棤寮�绁ㄥ彴璐︽暟鎹�</text>
 		</view>
-
+		
 		<!-- 绛涢�夊脊绐� -->
-		<van-popup v-model:show="showFilter" position="bottom" round>
+		<up-popup v-model="showFilter" mode="bottom" round><up-transition>
 			<view class="filter-popup">
-				<van-cell-group title="绛涢�夋潯浠�" inset>
-					<van-field
+				<up-cell-group title="绛涢�夋潯浠�" inset>
+					<up-input
 						label="寮�绁ㄦ棩鏈�"
 						readonly
+						placeholder="璇烽�夋嫨鏃ユ湡鑼冨洿"
 						@click="showInvoiceRange = true"
-						:placeholder="invoiceRangeLabel || '璇烽�夋嫨鏃ユ湡鑼冨洿'"
+						v-model="invoiceRangeLabel"
 					/>
-					<van-field
+					<up-input
 						label="褰曞叆鏃ユ湡"
 						readonly
 						@click="showCreateDatePicker = true"
-						:placeholder="searchForm.createTimeStart || '璇烽�夋嫨褰曞叆鏃ユ湡'"
+						v-model="searchForm.createTimeStart"
 					/>
 					<view class="switch-row">
 						<text class="switch-label">涓嶆樉绀烘湁鍙戠エ琛�</text>
-						<van-switch v-model="searchForm.status" size="20" />
+						<up-switch v-model="searchForm.status" size="20" />
 					</view>
-				</van-cell-group>
+				</up-cell-group>
 				<view class="filter-actions">
-					<van-button @click="resetFilter">閲嶇疆</van-button>
-					<van-button type="primary" @click="confirmFilter">纭畾</van-button>
+					<up-button @click="resetFilter">閲嶇疆</up-button>
+					<up-button type="primary" @click="confirmFilter">纭畾</up-button>
 				</view>
 			</view>
-		</van-popup>
-
+		</up-transition></up-popup>
+		
 		<!-- 鏃ュ巻锛氬紑绁ㄦ棩鏈熻寖鍥� -->
-		<van-popup v-model:show="showInvoiceRange" position="bottom">
-			<van-calendar
-				title="閫夋嫨寮�绁ㄦ棩鏈熻寖鍥�"
+		<up-popup v-model="showInvoiceRange" mode="bottom"><up-transition>
+			<up-datetime-picker
+				mode="date"
 				type="range"
-				color="#2979ff"
+				title="閫夋嫨寮�绁ㄦ棩鏈熻寖鍥�"
 				@confirm="onInvoiceRangeConfirm"
 				@cancel="showInvoiceRange = false"
 			/>
-		</van-popup>
-
+		</up-transition></up-popup>
+		
 		<!-- 鏃ユ湡锛氬綍鍏ユ棩鏈� -->
-		<van-popup v-model:show="showCreateDatePicker" position="bottom">
-			<van-date-picker
+		<up-popup v-model="showCreateDatePicker" mode="bottom"><up-transition>
+			<up-datetime-picker
+				mode="date"
+				type="selector"
 				v-model="currentCreateDate"
 				title="閫夋嫨褰曞叆鏃ユ湡"
 				@confirm="onCreateDateConfirm"
 				@cancel="showCreateDatePicker = false"
 			/>
-		</van-popup>
-
+		</up-transition></up-popup>
 		
-
+		
+		
 		<!-- 鍗曡涓婁紶寮圭獥锛堟棤琛ㄥ崟锛� -->
-		<van-popup v-model:show="showUpload" position="bottom" round>
+		<up-popup v-model="showUpload" mode="bottom" round><up-transition>
 			<view class="upload-container">
-				<van-cell-group title="涓婁紶闄勪欢锛堜粎鏀寔 pdf锛屾渶澶�10MB锛屾渶澶�10涓級" inset>
-					<van-uploader
-						accept="*"
+				<up-cell-group title="涓婁紶闄勪欢锛堜粎鏀寔 pdf锛屾渶澶�10MB锛屾渶澶�10涓級" inset>
+					<up-upload
+						accept="pdf"
 						multiple
-						:max-count="10"
-						:after-read="afterReadRowUpload"
-						:before-read="beforeReadPdf"
-					/>
+						:maxCount="10"
+						:afterRead="afterReadRowUpload"
+						:beforeRead="beforeReadPdf"
+					>
+						<up-button type="primary">鐐瑰嚮涓婁紶</up-button>
+					</up-upload>
 					<view class="uploaded-list" v-if="fileList.length">
 						<view class="uploaded-item" v-for="(f, idx) in fileList" :key="idx">
 							<text class="file-name">{{ f.name || getFileNameFromUrl(f.url) }}</text>
-							<van-button size="mini" type="danger" plain @click="removeUploaded(idx)">绉婚櫎</van-button>
+							<up-button size="mini" type="error" plain @click="removeUploaded(idx)">绉婚櫎</up-button>
 						</view>
 					</view>
-				</van-cell-group>
+				</up-cell-group>
 				<view class="filter-actions">
-					<van-button @click="showUpload = false">鍙栨秷</van-button>
-					<van-button type="primary" @click="confirmUpload">纭</van-button>
+					<up-button @click="showUpload = false">鍙栨秷</up-button>
+					<up-button type="primary" @click="confirmUpload">纭</up-button>
 				</view>
 			</view>
-		</van-popup>
-
+		</up-transition></up-popup>
+		
 		<!-- 闄勪欢鍒楄〃閫夋嫨 -->
-		<van-action-sheet v-model:show="showFileSheet" :actions="fileActions" cancel-text="鍙栨秷" close-on-click-action @select="onSelectFile" />
+		<up-action-sheet v-model="showFileSheet" :actions="fileActions" cancel-text="鍙栨秷" close-on-click-action @select="onSelectFile">
+			<view class="up-action-sheet__cancel" @click="showFileSheet = false">
+				鍙栨秷
+			</view>
+		</up-action-sheet>
 	</view>
 </template>
 
 <script setup>
-import { ref, reactive, onMounted } from 'vue'
+import {reactive, ref} from 'vue'
 import dayjs from 'dayjs'
-import { showToast, showLoadingToast, closeToast } from 'vant'
+import PageHeader from '@/components/PageHeader.vue'
 import useUserStore from '@/store/modules/user'
-import { getToken } from '@/utils/auth'
+import {getToken} from '@/utils/auth'
 import config from '@/config.js'
 import {
-	registrationProductPage,
 	commitFile,
-	delInvoiceLedgerByRegProductId
+	delInvoiceLedgerByRegProductId,
+	registrationProductPage
 } from '@/api/salesManagement/invoiceLedger.js'
 import {onShow} from "@dcloudio/uni-app";
+
+const showToast = (message) => {
+	uni.showToast({
+		title: message,
+		icon: 'none'
+	})
+}
+const showLoadingToast = (message) => {
+	uni.showLoading({
+		title: message,
+		mask: true
+	})
+}
+const closeToast = () => {
+	uni.hideLoading()
+}
 
 const userStore = useUserStore()
 
 // 鍒楄〃涓庢煡璇�
 const ledgerList = ref([])
-const total = ref(0)
 const page = reactive({ current: -1, size: -1 })
 const searchForm = reactive({
 	searchText: '',
@@ -283,14 +300,11 @@
 
 const getList = async () => {
 	try {
-		showLoadingToast({ message: '鍔犺浇涓�...' })
+		showLoadingToast('鍔犺浇涓�...')
 		const { invoiceDate, ...rest } = searchForm
 		const res = await registrationProductPage({ ...rest, ...page })
 		// 鍏煎涓嶅悓杩斿洖缁撴瀯
-		const records = res?.data?.records || res?.records || res?.data || []
-		const totalVal = res?.data?.total || res?.total || records.length || 0
-		ledgerList.value = records
-		total.value = totalVal
+		ledgerList.value = res?.data?.records || res?.records || res?.data || []
 		closeToast()
 	} catch (e) {
 		closeToast()
@@ -314,19 +328,10 @@
 	showFilter.value = false
 	getList()
 }
-const onInvoiceRangeConfirm = (e) => {
-	// e 涓� [start, end] 鐨� Date 瀵硅薄鎴栧瓧绗︿覆锛寀ni-app 涓� Vant Calendar 杩斿洖鏃堕棿鎴虫暟缁�
+const onInvoiceRangeConfirm = ({ selectedValues }) => {
 	try {
-		let start, end
-		if (Array.isArray(e)) {
-			const [s, ed] = e
-			start = dayjs(s).format('YYYY-MM-DD')
-			end = dayjs(ed).format('YYYY-MM-DD')
-		} else if (e && e.detail && Array.isArray(e.detail)) {
-			const [s, ed] = e.detail
-			start = dayjs(s).format('YYYY-MM-DD')
-			end = dayjs(ed).format('YYYY-MM-DD')
-		}
+		const start = dayjs(selectedValues[0]).format('YYYY-MM-DD')
+		const end = dayjs(selectedValues[1]).format('YYYY-MM-DD')
 		searchForm.invoiceDateStart = start
 		searchForm.invoiceDateEnd = end
 		invoiceRangeLabel.value = `${start} 鑷� ${end}`
@@ -363,7 +368,7 @@
 		success: async (res) => {
 			if (res.confirm) {
 				try {
-					showLoadingToast({ message: '澶勭悊涓�...' })
+					showLoadingToast('澶勭悊涓�...')
 					await delInvoiceLedgerByRegProductId(row.id)
 					closeToast()
 					showToast('鍒犻櫎鎴愬姛')
@@ -386,7 +391,7 @@
 const confirmUpload = async () => {
 	try {
 		const payload = { fileList: fileList.value, id: currentId.value }
-		showLoadingToast({ message: '鎻愪氦涓�...' })
+		showLoadingToast('鎻愪氦涓�...')
 		await commitFile(payload)
 		closeToast()
 		showToast('鎻愪氦鎴愬姛')
@@ -421,7 +426,7 @@
 
 const uploadSingleFile = async (fileObj) => {
 	return new Promise((resolve, reject) => {
-		showLoadingToast({ message: '姝e湪涓婁紶...' })
+		showLoadingToast('姝e湪涓婁紶...')
 		uni.uploadFile({
 			url: config.baseUrl + '/invoiceLedger/uploadFile',
 			filePath: fileObj.url || fileObj.file?.path || fileObj.tempFilePath,
@@ -497,7 +502,7 @@
 	try {
 		const item = currentFilesToOpen[action.index]
 		if (!item || !item.url) return
-		showLoadingToast({ message: '涓嬭浇涓�...' })
+		showLoadingToast('涓嬭浇涓�...')
 		uni.downloadFile({
 			url: item.url,
 			success: (res) => {
@@ -525,165 +530,15 @@
 </script>
 
 <style scoped lang="scss">
-.u-divider {
-	margin: 0 !important;
-}
-.sales-account {
-	min-height: 100vh;
-	background: #f8f9fa;
-	position: relative;
-}
+@import '@/styles/sales-common.scss';
 
-.search-filter-section {
-	padding: 10px 20px;
-	background: #ffffff;
-}
-
-.search-bar {
-	display: flex;
-	align-items: center;
-	gap: 12px;
-}
-
-.search-input {
-	flex: 1;
-	background: #f5f5f5;
-	border-radius: 24px;
-	padding: 10px 16px;
-	display: flex;
-	align-items: center;
-	gap: 8px;
-}
-
-.search-text {
-	flex: 1;
-	font-size: 14px;
-	color: #333;
-	background: transparent;
-	border: none;
-	outline: none;
-}
-
-.search-text::placeholder {
-	color: #999;
-}
-
-.filter-button {
-	width: 40px;
-	height: 40px;
-	border-radius: 8px;
-	display: flex;
-	align-items: center;
-	justify-content: center;
-}
-
-.ledger-list {
-	padding: 20px;
-}
-
-.ledger-item {
-	background: #ffffff;
-	border-radius: 12px;
-	margin-bottom: 16px;
-	overflow: hidden;
-	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
-	padding: 0 16px;
-}
-
-.item-header {
-	padding: 16px 0;
-	display: flex;
-	align-items: center;
-	justify-content: space-between;
-}
-
-.item-left {
-	display: flex;
-	align-items: center;
-	gap: 8px;
-}
-
-.document-icon {
-	width: 24px;
-	height: 24px;
-	background: #2979ff;
-	border-radius: 4px;
-	display: flex;
-	align-items: center;
-	justify-content: center;
-}
-
-.item-id {
-	font-size: 14px;
-	color: #333;
-	font-weight: 500;
-}
-
-.item-details {
-	padding: 16px 0;
-}
-
-.detail-row {
-	display: flex;
-	align-items: flex-end;
-	justify-content: space-between;
-	margin-bottom: 8px;
-
-	&:last-child {
-		margin-bottom: 0;
-	}
-}
-
-.detail-label {
-	font-size: 12px;
-	color: #777777;
-	min-width: 60px;
-}
-
-.detail-value {
-	font-size: 12px;
-	color: #000000;
-	text-align: right;
-	flex: 1;
-	margin-left: 16px;
-}
-
-.detail-value.highlight {
-	color: #2979ff;
-	font-weight: 500;
-}
-
-.no-data {
-	padding: 40px 0;
-	text-align: center;
-	color: #999;
-}
-
-.action-buttons {
-	display: flex;
-	gap: 12px;
-	padding: 0 0 16px 0;
-	justify-content: space-between;
-}
-
-.action-btn {
-	flex: 1;
-}
-
+// 寮�绁ㄥ彴璐︾壒鏈夋牱寮�
 .filter-popup {
 	padding: 12px 12px 20px;
 }
 
 .switch-row {
 	padding: 12px 16px;
-	display: flex;
-	align-items: center;
-	justify-content: space-between;
-}
-
-.switch-label {
-	font-size: 14px;
-	color: #333;
 }
 
 .filter-actions {
@@ -738,6 +593,7 @@
 	box-shadow: 0 -0.125rem 0.5rem rgba(0,0,0,0.05);
 	z-index: 1000;
 }
+
 .cancel-btn {
 	font-weight: 400;
 	font-size: 1rem;
@@ -747,6 +603,7 @@
 	box-shadow: 0 0.25rem 0.625rem 0 rgba(3,88,185,0.2);
 	border-radius: 2.5rem 2.5rem 2.5rem 2.5rem;
 }
+
 .save-btn {
 	font-weight: 400;
 	font-size: 1rem;

--
Gitblit v1.9.3