This commit is contained in:
menxipeng
2025-11-29 17:56:32 +08:00
parent 5164d2ec46
commit df0e7a16d9
2 changed files with 11 additions and 9 deletions

View File

@@ -653,10 +653,10 @@ export default function EquipmentPage() {
const installDate = e.target.value const installDate = e.target.value
setNewEquipment({ ...newEquipment, installDate }) setNewEquipment({ ...newEquipment, installDate })
// 自动填充下一次检测时间(安装日期+1年) // 自动更新下一次检测时间(安装日期+年)
if (installDate && !newEquipment.nextInspectionDate) { if (installDate) {
const nextDate = new Date(installDate) const nextDate = new Date(installDate)
nextDate.setFullYear(nextDate.getFullYear() + 1) nextDate.setMonth(nextDate.getMonth() + 6)
const nextDateStr = nextDate.toISOString().split('T')[0] const nextDateStr = nextDate.toISOString().split('T')[0]
setNewEquipment(prev => ({ ...prev, nextInspectionDate: nextDateStr })) setNewEquipment(prev => ({ ...prev, nextInspectionDate: nextDateStr }))
} }
@@ -869,10 +869,10 @@ export default function EquipmentPage() {
const installDate = e.target.value const installDate = e.target.value
setEditEquipment({ ...editEquipment, installDate }) setEditEquipment({ ...editEquipment, installDate })
// 自动填充下一次检测时间(安装日期+1年) // 自动更新下一次检测时间(安装日期+年)
if (installDate && !editEquipment.nextInspectionDate) { if (installDate) {
const nextDate = new Date(installDate) const nextDate = new Date(installDate)
nextDate.setFullYear(nextDate.getFullYear() + 1) nextDate.setMonth(nextDate.getMonth() + 6)
const nextDateStr = nextDate.toISOString().split('T')[0] const nextDateStr = nextDate.toISOString().split('T')[0]
setEditEquipment(prev => ({ ...prev, nextInspectionDate: nextDateStr })) setEditEquipment(prev => ({ ...prev, nextInspectionDate: nextDateStr }))
} }

View File

@@ -64,9 +64,11 @@ interface Mall {
mallName: string mallName: string
addr: string addr: string
province: string province: string
provinceName?: string
creator: string creator: string
updator: string | null updator: string | null
mallUser: string mallUser: string
mallUserName?: string
status: string status: string
} }
@@ -823,7 +825,7 @@ export default function MallsPage() {
</div> </div>
<div className="flex justify-between"> <div className="flex justify-between">
<span className="text-sm text-gray-600">:</span> <span className="text-sm text-gray-600">:</span>
<span className="text-sm font-medium">{deletingMall.province}</span> <span className="text-sm font-medium">{deletingMall.provinceName || deletingMall.province}</span>
</div> </div>
<div className="flex justify-between"> <div className="flex justify-between">
<span className="text-sm text-gray-600">:</span> <span className="text-sm text-gray-600">:</span>
@@ -899,9 +901,9 @@ export default function MallsPage() {
<div className="text-left sm:text-right"> <div className="text-left sm:text-right">
<div className="text-xs sm:text-sm font-medium">: {mall.creator}</div> <div className="text-xs sm:text-sm font-medium">: {mall.creator}</div>
<div className="text-xs text-gray-500 flex flex-wrap items-center sm:justify-end gap-1 mt-1"> <div className="text-xs text-gray-500 flex flex-wrap items-center sm:justify-end gap-1 mt-1">
<span>: {mall.province}</span> <span>: {mall.provinceName || mall.province}</span>
<span className="hidden sm:inline">|</span> <span className="hidden sm:inline">|</span>
<span>: {mall.mallUser}</span> <span>: {mall.mallUserName || mall.mallUser}</span>
</div> </div>
</div> </div>
<div className="flex items-center gap-2 flex-shrink-0"> <div className="flex items-center gap-2 flex-shrink-0">