From bdca092494179de8c30f0a46ed77da9004cb6a6b Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期一, 29 六月 2026 14:06:19 +0800
Subject: [PATCH] feat(pages): 优化1、出差审批增加出差开始时间和出差结束时间2、开放一些新增修改功能3、销售报价去掉数量
---
src/pages/cooperativeOffice/collaborativeApproval/approve.vue | 21 +++-
src/pages/procurementManagement/procurementLedger/index.vue | 8 +-
src/pages/cooperativeOffice/collaborativeApproval/detail.vue | 123 ++++++++++++++++++++++++++++--
src/pages/sales/salesAccount/index.vue | 16 ++--
src/pages/sales/salesQuotation/detail.vue | 14 +--
src/pages/sales/salesQuotation/edit.vue | 27 +-----
6 files changed, 149 insertions(+), 60 deletions(-)
diff --git a/src/pages/cooperativeOffice/collaborativeApproval/approve.vue b/src/pages/cooperativeOffice/collaborativeApproval/approve.vue
index b3c8687..04d1c9f 100644
--- a/src/pages/cooperativeOffice/collaborativeApproval/approve.vue
+++ b/src/pages/cooperativeOffice/collaborativeApproval/approve.vue
@@ -36,11 +36,20 @@
</view>
</template>
<!-- approveType=3 鍑哄樊鐩稿叧瀛楁 -->
- <view v-if="approvalData.approveType === 3"
- class="info-row">
- <text class="info-label">鍑哄樊鍦扮偣</text>
- <text class="info-value">{{ approvalData.location || '-' }}</text>
- </view>
+ <template v-if="approvalData.approveType === 3">
+ <view class="info-row">
+ <text class="info-label">鍑哄樊鍦扮偣</text>
+ <text class="info-value">{{ approvalData.location || '-' }}</text>
+ </view>
+ <view class="info-row">
+ <text class="info-label">鍑哄樊寮�濮嬫椂闂�</text>
+ <text class="info-value">{{ approvalData.startDateTime || '-' }}</text>
+ </view>
+ <view class="info-row">
+ <text class="info-label">鍑哄樊缁撴潫鏃堕棿</text>
+ <text class="info-value">{{ approvalData.endDateTime || '-' }}</text>
+ </view>
+ </template>
<!-- approveType=4 鎶ラ攢鐩稿叧瀛楁 -->
<view v-if="approvalData.approveType === 4"
class="info-row">
@@ -554,4 +563,4 @@
display: flex;
justify-content: flex-end;
}
-</style>
\ No newline at end of file
+</style>
diff --git a/src/pages/cooperativeOffice/collaborativeApproval/detail.vue b/src/pages/cooperativeOffice/collaborativeApproval/detail.vue
index 16f9923..377de64 100644
--- a/src/pages/cooperativeOffice/collaborativeApproval/detail.vue
+++ b/src/pages/cooperativeOffice/collaborativeApproval/detail.vue
@@ -87,14 +87,39 @@
</u-form-item>
</template>
<!-- approveType=3 鍑哄樊鐩稿叧瀛楁 -->
- <u-form-item v-if="approveType === 3"
- prop="location"
- label="鍑哄樊鍦扮偣"
- required>
- <u-input v-model="form.location"
- placeholder="璇疯緭鍏ュ嚭宸湴鐐�"
- clearable />
- </u-form-item>
+ <template v-if="approveType === 3">
+ <u-form-item prop="location"
+ label="鍑哄樊鍦扮偣"
+ required>
+ <u-input v-model="form.location"
+ placeholder="璇疯緭鍏ュ嚭宸湴鐐�"
+ clearable />
+ </u-form-item>
+ <u-form-item prop="startDateTime"
+ label="鍑哄樊寮�濮嬫椂闂�"
+ required>
+ <u-input v-model="form.startDateTime"
+ readonly
+ placeholder="璇烽�夋嫨鍑哄樊寮�濮嬫椂闂�"
+ @click="showTripStartDateTimePicker" />
+ <template #right>
+ <up-icon name="arrow-right"
+ @click="showTripStartDateTimePicker"></up-icon>
+ </template>
+ </u-form-item>
+ <u-form-item prop="endDateTime"
+ label="鍑哄樊缁撴潫鏃堕棿"
+ required>
+ <u-input v-model="form.endDateTime"
+ readonly
+ placeholder="璇烽�夋嫨鍑哄樊缁撴潫鏃堕棿"
+ @click="showTripEndDateTimePicker" />
+ <template #right>
+ <up-icon name="arrow-right"
+ @click="showTripEndDateTimePicker"></up-icon>
+ </template>
+ </u-form-item>
+ </template>
<!-- approveType=4 鎶ラ攢鐩稿叧瀛楁 -->
<u-form-item v-if="approveType === 4"
prop="price"
@@ -325,6 +350,26 @@
@cancel="showEndDate = false"
mode="date" />
</up-popup>
+ <!-- 鍑哄樊寮�濮嬫椂闂撮�夋嫨鍣� -->
+ <up-popup :show="showTripStartDateTime"
+ mode="bottom"
+ @close="showTripStartDateTime = false">
+ <up-datetime-picker :show="true"
+ v-model="tripStartDateTimeValue"
+ @confirm="onTripStartDateTimeConfirm"
+ @cancel="showTripStartDateTime = false"
+ mode="datetime" />
+ </up-popup>
+ <!-- 鍑哄樊缁撴潫鏃堕棿閫夋嫨鍣� -->
+ <up-popup :show="showTripEndDateTime"
+ mode="bottom"
+ @close="showTripEndDateTime = false">
+ <up-datetime-picker :show="true"
+ v-model="tripEndDateTimeValue"
+ @confirm="onTripEndDateTimeConfirm"
+ @cancel="showTripEndDateTime = false"
+ mode="datetime" />
+ </up-popup>
</template>
<!-- 搴曢儴鎸夐挳 -->
<view class="footer-btns"
@@ -350,7 +395,7 @@
import PageHeader from "@/components/PageHeader.vue";
import CommonUpload from "@/components/CommonUpload.vue";
import useUserStore from "@/store/modules/user";
- import { formatDateToYMD } from "@/utils/ruoyi";
+ import { formatDateToYMD, parseTime } from "@/utils/ruoyi";
import {
getDept,
approveProcessGetInfo,
@@ -380,6 +425,8 @@
storageBlobDTOS: [],
startDate: "",
endDate: "",
+ startDateTime: "",
+ endDateTime: "",
location: "",
price: "",
},
@@ -394,6 +441,12 @@
],
endDate: [
{ required: false, message: "璇烽�夋嫨缁撴潫鏃堕棿", trigger: "change" },
+ ],
+ startDateTime: [
+ { required: false, message: "璇烽�夋嫨鍑哄樊寮�濮嬫椂闂�", trigger: "change" },
+ ],
+ endDateTime: [
+ { required: false, message: "璇烽�夋嫨鍑哄樊缁撴潫鏃堕棿", trigger: "change" },
],
location: [{ required: false, message: "璇疯緭鍏ュ嚭宸湴鐐�", trigger: "blur" }],
price: [{ required: false, message: "璇疯緭鍏ユ姤閿�閲戦", trigger: "blur" }],
@@ -413,6 +466,10 @@
const startDateValue = ref(Date.now());
const showEndDate = ref(false);
const endDateValue = ref(Date.now());
+ const showTripStartDateTime = ref(false);
+ const tripStartDateTimeValue = ref(Date.now());
+ const showTripEndDateTime = ref(false);
+ const tripEndDateTimeValue = ref(Date.now());
const userStore = useUserStore();
const approveType = ref(0);
const isInitialLoading = ref(false);
@@ -475,6 +532,24 @@
const onEndDateConfirm = e => {
form.value.endDate = formatDateToYMD(e.value);
showEndDate.value = false;
+ };
+
+ const showTripStartDateTimePicker = () => {
+ showTripStartDateTime.value = true;
+ };
+
+ const onTripStartDateTimeConfirm = e => {
+ form.value.startDateTime = parseTime(e.value, "{y}-{m}-{d} {h}:{i}");
+ showTripStartDateTime.value = false;
+ };
+
+ const showTripEndDateTimePicker = () => {
+ showTripEndDateTime.value = true;
+ };
+
+ const onTripEndDateTimeConfirm = e => {
+ form.value.endDateTime = parseTime(e.value, "{y}-{m}-{d} {h}:{i}");
+ showTripEndDateTime.value = false;
};
const fetchDetailData = async row => {
@@ -647,6 +722,34 @@
return;
}
+ if (Number(approveType.value) === 3) {
+ if (!form.value.location || !String(form.value.location).trim()) {
+ showToast("璇疯緭鍏ュ嚭宸湴鐐�");
+ return;
+ }
+
+ if (!form.value.startDateTime) {
+ showToast("璇烽�夋嫨鍑哄樊寮�濮嬫椂闂�");
+ return;
+ }
+
+ if (!form.value.endDateTime) {
+ showToast("璇烽�夋嫨鍑哄樊缁撴潫鏃堕棿");
+ return;
+ }
+
+ const start = new Date(String(form.value.startDateTime).replace(/-/g, "/"));
+ const end = new Date(String(form.value.endDateTime).replace(/-/g, "/"));
+ if (
+ Number.isFinite(start.getTime()) &&
+ Number.isFinite(end.getTime()) &&
+ end < start
+ ) {
+ showToast("鍑哄樊缁撴潫鏃堕棿涓嶈兘鏃╀簬寮�濮嬫椂闂�");
+ return;
+ }
+ }
+
formRef.value
.validate()
.then(valid => {
@@ -737,4 +840,4 @@
box-shadow: 0 0.25rem 0.625rem 0 rgba(3, 88, 185, 0.2);
border-radius: 2.5rem 2.5rem 2.5rem 2.5rem;
}
-</style>
\ No newline at end of file
+</style>
diff --git a/src/pages/procurementManagement/procurementLedger/index.vue b/src/pages/procurementManagement/procurementLedger/index.vue
index 615a00d..4547182 100644
--- a/src/pages/procurementManagement/procurementLedger/index.vue
+++ b/src/pages/procurementManagement/procurementLedger/index.vue
@@ -77,7 +77,7 @@
</view>
</view>
<!-- 浠呴潪鈥滃鎵归�氳繃鈥濈殑鍙拌处灞曠ず鍒犻櫎鎸夐挳 -->
- <!-- <view class="detail-row"
+ <view class="detail-row"
v-if="item.approvalStatus !== 3"
style="justify-content: flex-end; margin-top: 8px;">
<up-button type="error"
@@ -86,7 +86,7 @@
@click.stop="handleDelete(item)">
鍒犻櫎
</up-button>
- </view> -->
+ </view>
</view>
</view>
</view>
@@ -96,12 +96,12 @@
<text>鏆傛棤閲囪喘鍙拌处鏁版嵁</text>
</view>
<!-- 娴姩鎿嶄綔鎸夐挳 -->
- <!-- <view class="fab-button"
+ <view class="fab-button"
@click="handleInfo('add')">
<up-icon name="plus"
size="24"
color="#ffffff"></up-icon>
- </view> -->
+ </view>
</view>
</template>
diff --git a/src/pages/sales/salesAccount/index.vue b/src/pages/sales/salesAccount/index.vue
index d6a3d8c..74b906a 100644
--- a/src/pages/sales/salesAccount/index.vue
+++ b/src/pages/sales/salesAccount/index.vue
@@ -79,14 +79,14 @@
</view>
<up-divider></up-divider>
<view class="detail-buttons">
- <u-button class="detail-button"
+ <!-- <u-button class="detail-button"
size="small"
type="primary"
plain
@click.stop="openOut(item)">
鍙戣揣鐘舵��
- </u-button>
- <!-- <u-button class="detail-button"
+ </u-button> -->
+ <u-button class="detail-button"
size="small"
type="primary"
@click.stop="handleInfo('edit', item)">
@@ -98,14 +98,14 @@
plain
@click.stop="openOut(item)">
鍙戣揣鐘舵��
- </u-button> -->
- <!-- <u-button class="detail-button"
+ </u-button>
+ <u-button class="detail-button"
size="small"
type="error"
plain
@click.stop="handleDelete(item)">
鍒犻櫎
- </u-button> -->
+ </u-button>
</view>
</view>
</view>
@@ -116,12 +116,12 @@
<text>鏆傛棤閿�鍞彴璐︽暟鎹�</text>
</view>
<!-- 娴姩鎿嶄綔鎸夐挳 -->
- <!-- <view class="fab-button"
+ <view class="fab-button"
@click="handleInfo('add')">
<up-icon name="plus"
size="24"
color="#ffffff"></up-icon>
- </view> -->
+ </view>
</view>
</template>
diff --git a/src/pages/sales/salesQuotation/detail.vue b/src/pages/sales/salesQuotation/detail.vue
index 45c3fd6..df25931 100644
--- a/src/pages/sales/salesQuotation/detail.vue
+++ b/src/pages/sales/salesQuotation/detail.vue
@@ -65,16 +65,8 @@
<text class="info-value">{{ item.unit || "-" }}</text>
</view>
<view class="info-item">
- <text class="info-label">鏁伴噺</text>
- <text class="info-value">{{ item.quantity || "-" }}</text>
- </view>
- <view class="info-item">
<text class="info-label">鍗曚环</text>
<text class="info-value">{{ formatAmount(item.unitPrice) }}</text>
- </view>
- <view class="info-item">
- <text class="info-label">閲戦</text>
- <text class="info-value highlight">{{ formatAmount(item.amount) }}</text>
</view>
</view>
</view>
@@ -115,7 +107,11 @@
const loadDetailFromStorage = () => {
const cachedData = uni.getStorageSync("salesQuotationDetail");
- if (cachedData && (cachedData.id === quotationId.value || cachedData.id === Number(quotationId.value))) {
+ if (
+ cachedData &&
+ (cachedData.id === quotationId.value ||
+ cachedData.id === Number(quotationId.value))
+ ) {
detailData.value = cachedData;
} else {
detailData.value = cachedData || {};
diff --git a/src/pages/sales/salesQuotation/edit.vue b/src/pages/sales/salesQuotation/edit.vue
index bfcb930..5ac45f7 100644
--- a/src/pages/sales/salesQuotation/edit.vue
+++ b/src/pages/sales/salesQuotation/edit.vue
@@ -124,24 +124,12 @@
placeholder="璇疯緭鍏ュ崟浣�"
clearable />
</up-form-item>
- <up-form-item label="鏁伴噺">
- <up-input v-model="product.quantity"
- type="number"
- placeholder="璇疯緭鍏ユ暟閲�"
- clearable
- @blur="calculateAmount(product)" />
- </up-form-item>
<up-form-item label="鍗曚环">
<up-input v-model="product.unitPrice"
type="number"
placeholder="璇疯緭鍏ュ崟浠�"
clearable
@blur="calculateAmount(product)" />
- </up-form-item>
- <up-form-item label="閲戦">
- <up-input :model-value="formatAmount(product.amount)"
- disabled
- placeholder="鑷姩璁$畻" />
</up-form-item>
</view>
</view>
@@ -263,7 +251,7 @@
const totalAmount = computed(() =>
Number(
(form.value.products || [])
- .reduce((sum, item) => sum + Number(item.amount || 0), 0)
+ .reduce((sum, item) => sum + Number(item.unitPrice || 0), 0)
.toFixed(2)
)
);
@@ -294,9 +282,7 @@
productModelId: "",
ProductModel: "",
unit: "",
- quantity: 1,
unitPrice: 0,
- amount: 0,
modelOptions: [],
});
@@ -322,9 +308,7 @@
const goBack = () => uni.navigateBack();
const calculateAmount = product => {
- product.amount = Number(
- (Number(product.quantity || 0) * Number(product.unitPrice || 0)).toFixed(2)
- );
+ product.unitPrice = Number(Number(product.unitPrice || 0).toFixed(2));
form.value.totalAmount = totalAmount.value;
};
@@ -451,9 +435,7 @@
productModelId: item.productModelId || "",
ProductModel: item.ProductModel || item.specification || "",
unit: item.unit || "",
- quantity: Number(item.quantity || 1),
unitPrice: Number(item.unitPrice || 0),
- amount: Number(item.amount || 0),
modelOptions: [],
};
@@ -528,7 +510,6 @@
!item.productId ||
!item.productModelId ||
!item.unit ||
- !Number(item.quantity) ||
!Number(item.unitPrice)
);
if (invalid) {
@@ -554,10 +535,10 @@
product: item.product,
productModelId: item.productModelId,
ProductModel: item.ProductModel,
- quantity: Number(item.quantity || 0),
+ quantity: 1,
unit: item.unit,
unitPrice: Number(item.unitPrice || 0),
- amount: Number(item.amount || 0),
+ amount: Number(item.unitPrice || 0),
})),
};
const action = quotationId.value ? updateQuotation : addQuotation;
--
Gitblit v1.9.3