From 492802e4fc1b371ba21a2a490c8dcd67d7c8b29c Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期一, 22 六月 2026 14:03:40 +0800
Subject: [PATCH] fix: 出差和请假审批新增开始与结束日期
---
src/views/salesManagement/deliveryLedger/index.vue | 85 ++++++++++++++++++++++++++++++++----------
1 files changed, 64 insertions(+), 21 deletions(-)
diff --git a/src/views/salesManagement/deliveryLedger/index.vue b/src/views/salesManagement/deliveryLedger/index.vue
index 0d0ea70..6545adf 100644
--- a/src/views/salesManagement/deliveryLedger/index.vue
+++ b/src/views/salesManagement/deliveryLedger/index.vue
@@ -14,6 +14,11 @@
<el-input v-model="searchForm.expressNumber" placeholder="璇疯緭鍏�" clearable prefix-icon="Search" style="width: 200px"
@change="handleQuery" />
</el-form-item>
+ <el-form-item label="鍙戣揣鏃ユ湡锛�">
+ <el-date-picker v-model="shippingDateRange" type="daterange" range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�"
+ end-placeholder="缁撴潫鏃ユ湡" value-format="YYYY-MM-DD" format="YYYY-MM-DD" clearable style="width: 240px"
+ @change="handleShippingDateChange" />
+ </el-form-item>
<el-form-item>
<el-button type="primary" @click="handleQuery"> 鎼滅储 </el-button>
</el-form-item>
@@ -193,10 +198,12 @@
<div class="detail-images" v-if="detailImages.length">
<div class="detail-images-title">鍙戣揣鍥剧墖</div>
- <ImagePreview
- :src="detailImages.map(i => i.url).join(',')"
- width="120px"
- height="120px"
+ <el-image
+ v-for="img in detailImages"
+ :key="img.url"
+ :src="img.url"
+ :preview-src-list="detailImages.map(i => i.url)"
+ fit="cover"
class="detail-image"
/>
</div>
@@ -243,30 +250,44 @@
const detailRow = ref(null);
const detailImages = ref([]);
+const getFileAccessUrl = (file = {}) => {
+ if (file?.link) {
+ if (String(file.link).startsWith('http')) return file.link;
+ return normalizeFileUrl(file.link);
+ }
+ return normalizeFileUrl(file?.url || '');
+};
+
const normalizeFileUrl = (rawUrl = '') => {
let fileUrl = rawUrl || '';
if (fileUrl && fileUrl.indexOf('\\') > -1) {
- const lowerPath = fileUrl.toLowerCase();
- const uploadPathIndex = lowerPath.indexOf('uploadpath');
-
- if (uploadPathIndex > -1) {
- fileUrl = fileUrl
- .substring(uploadPathIndex)
- .replace(/\\/g, '/');
- } else {
- fileUrl = fileUrl.replace(/\\/g, '/');
- }
+ fileUrl = fileUrl.replace(/\\/g, '/');
}
- fileUrl = fileUrl.replace(/^\/?uploadPath/, '/profile');
- if (!fileUrl.startsWith('http')) {
+ const lowerPath = fileUrl.toLowerCase();
+
+ const uploadPathIndex = lowerPath.indexOf('/uploadpath/');
+ if (uploadPathIndex > -1) {
+ fileUrl = '/profile' + fileUrl.substring(uploadPathIndex + '/uploadpath'.length);
+ }
+
+ const fileRootIndex = fileUrl.toLowerCase().indexOf('/file/');
+ if (!fileUrl.startsWith('/profile/') && fileRootIndex > -1) {
+ fileUrl = '/profile' + fileUrl.substring(fileRootIndex + '/file'.length);
+ }
+
+ if (!fileUrl.startsWith('http') && fileUrl.toLowerCase().startsWith('profile/')) {
+ fileUrl = '/' + fileUrl;
+ }
+
+ if (fileUrl && !fileUrl.startsWith('http')) {
if (!fileUrl.startsWith('/')) fileUrl = '/' + fileUrl;
fileUrl = javaApi + fileUrl;
}
-
return fileUrl;
};
+
// 涓婁紶閰嶇疆
const upload = reactive({
// 涓婁紶鐨勫湴鍧�
@@ -278,11 +299,14 @@
// 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
const operationType = ref("");
const dialogFormVisible = ref(false);
+const shippingDateRange = ref([]);
const data = reactive({
searchForm: {
salesContractNo: "", // 閿�鍞鍗曞彿
shippingCarNumber: "", // 杞︾墝鍙�
expressNumber: "", // 蹇�掑崟鍙�
+ shippingDateStart: "", // 鍙戣揣鏃ユ湡寮�濮�
+ shippingDateEnd: "", // 鍙戣揣鏃ユ湡缁撴潫
},
form: {
id: null,
@@ -320,6 +344,18 @@
const handleQuery = () => {
page.current = 1;
getList();
+};
+
+// 鍙戣揣鏃ユ湡鍙樻洿
+const handleShippingDateChange = (value) => {
+ if (value && value.length === 2) {
+ searchForm.value.shippingDateStart = value[0];
+ searchForm.value.shippingDateEnd = value[1];
+ } else {
+ searchForm.value.shippingDateStart = "";
+ searchForm.value.shippingDateEnd = "";
+ }
+ handleQuery();
};
const paginationChange = (obj) => {
@@ -379,7 +415,7 @@
// 濡傛灉鏈夊浘鐗囷紝灏� commonFileList 杞崲涓烘枃浠跺垪琛ㄦ牸寮�
if (row.commonFileList && Array.isArray(row.commonFileList) && row.commonFileList.length > 0) {
deliveryFileList.value = row.commonFileList.map((file, index) => {
- const fileUrl = normalizeFileUrl(file.url || '');
+ const fileUrl = getFileAccessUrl(file);
return {
uid: file.id || Date.now() + index,
@@ -421,7 +457,7 @@
detailRow.value = row || null;
const list = Array.isArray(row?.commonFileList) ? row.commonFileList : [];
detailImages.value = list
- .map((f) => ({ url: normalizeFileUrl(f?.url || '') }))
+ .map((f) => ({ url: getFileAccessUrl(f) }))
.filter((i) => !!i.url);
detailDialogVisible.value = true;
};
@@ -466,13 +502,20 @@
// 瀵煎嚭
const handleOut = () => {
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ ElMessageBox.confirm("鏄惁纭瀵煎嚭鍙戣揣鍙拌处鏁版嵁锛�", "瀵煎嚭", {
confirmButtonText: "纭",
cancelButtonText: "鍙栨秷",
type: "warning",
})
.then(() => {
- proxy.download("/shippingInfo/export", {}, "鍙戣揣鍙拌处.xlsx");
+ const params = {
+ salesContractNo: searchForm.value.salesContractNo,
+ shippingCarNumber: searchForm.value.shippingCarNumber,
+ expressNumber: searchForm.value.expressNumber,
+ shippingDateStart: searchForm.value.shippingDateStart,
+ shippingDateEnd: searchForm.value.shippingDateEnd,
+ };
+ proxy.download("/shippingInfo/export", params, "鍙戣揣鍙拌处.xlsx");
})
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
--
Gitblit v1.9.3