|
|
@ -5,45 +5,67 @@ |
|
|
|
<div class="search-item"> |
|
|
|
<span class="option-label">采购时间</span> |
|
|
|
<el-date-picker |
|
|
|
v-model="procurementTime" |
|
|
|
type="date" |
|
|
|
format="YYYY-MM-DD" |
|
|
|
value-format="YYYY-MM-DD" |
|
|
|
placeholder="选择日期" |
|
|
|
style="width: 240px" |
|
|
|
v-model="procurementTime" |
|
|
|
type="date" |
|
|
|
format="YYYY-MM-DD" |
|
|
|
value-format="YYYY-MM-DD" |
|
|
|
placeholder="选择日期" |
|
|
|
style="width: 240px" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<div class="search-item" style="margin-left: 10px"> |
|
|
|
<span class="option-label">物资名称</span> |
|
|
|
<el-input |
|
|
|
v-model="materialName" |
|
|
|
placeholder="请输入物资名称" |
|
|
|
style="width: 200px" |
|
|
|
v-model="materialName" |
|
|
|
placeholder="请输入物资名称" |
|
|
|
style="width: 200px" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="right-options"> |
|
|
|
<el-button type="primary" class="search-btn !ml-12" @click="handleSearch">查询</el-button> |
|
|
|
<el-button @click="handleReset">重置</el-button> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
class="search-btn !ml-12" |
|
|
|
@click="handleSearch" |
|
|
|
>查询</el-button |
|
|
|
> |
|
|
|
<el-button @click="handleReset">重置</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="table-container"> |
|
|
|
<el-table :data="tableData" border style="width: 100%;color: black"> |
|
|
|
<el-table :data="tableData" border style="width: 100%; color: black"> |
|
|
|
<el-table-column type="index" label="序号" width="120" align="center" /> |
|
|
|
<el-table-column prop="materialName" label="物资名称" width="180" align="center" /> |
|
|
|
<el-table-column prop="materialNumber" label="物资数量" align="center" /> |
|
|
|
<el-table-column prop="materialType" label="物资类型" align="center" > |
|
|
|
<el-table-column |
|
|
|
prop="materialName" |
|
|
|
label="物资名称" |
|
|
|
width="180" |
|
|
|
align="center" |
|
|
|
/> |
|
|
|
<el-table-column |
|
|
|
prop="materialNumber" |
|
|
|
label="物资数量" |
|
|
|
align="center" |
|
|
|
/> |
|
|
|
<el-table-column prop="materialType" label="物资类型" align="center"> |
|
|
|
<template #default="scope"> |
|
|
|
{{projTypeFormat(scope.row.materialType)}} |
|
|
|
{{ projTypeFormat(scope.row.materialType) }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="procurementTime" label="采购时间" align="center" /> |
|
|
|
<el-table-column |
|
|
|
prop="procurementTime" |
|
|
|
label="采购时间" |
|
|
|
align="center" |
|
|
|
/> |
|
|
|
<el-table-column prop="personName" label="负责人" align="center" /> |
|
|
|
<el-table-column label="操作" align="center" width="120"> |
|
|
|
<template #default="scope"> |
|
|
|
<el-button type="text" class="view-button" @click="handleView(scope.row)">查看</el-button> |
|
|
|
<el-button |
|
|
|
type="text" |
|
|
|
class="view-button" |
|
|
|
@click="handleView(scope.row)" |
|
|
|
>查看</el-button |
|
|
|
> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
@ -51,7 +73,11 @@ |
|
|
|
|
|
|
|
<Teleport to="body"> |
|
|
|
<Transition name="dialog-fade"> |
|
|
|
<div v-if="dialogVisible" class="modern-dialog-overlay" @click="handleOverlayClick"> |
|
|
|
<div |
|
|
|
v-if="dialogVisible" |
|
|
|
class="modern-dialog-overlay" |
|
|
|
@click="handleOverlayClick" |
|
|
|
> |
|
|
|
<div class="modern-dialog-container" @click.stop> |
|
|
|
<div class="modern-dialog-header"> |
|
|
|
<div class="modern-dialog-title"> |
|
|
@ -60,9 +86,15 @@ |
|
|
|
</div> |
|
|
|
<h3>防汛物资详情</h3> |
|
|
|
</div> |
|
|
|
<button class="modern-dialog-close" @click="dialogVisible = false"> |
|
|
|
<button |
|
|
|
class="modern-dialog-close" |
|
|
|
@click="dialogVisible = false" |
|
|
|
> |
|
|
|
<svg viewBox="0 0 24 24" width="24" height="24"> |
|
|
|
<path fill="currentColor" d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/> |
|
|
|
<path |
|
|
|
fill="currentColor" |
|
|
|
d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" |
|
|
|
/> |
|
|
|
</svg> |
|
|
|
</button> |
|
|
|
</div> |
|
|
@ -70,171 +102,179 @@ |
|
|
|
<div class="modern-dialog-content"> |
|
|
|
<div class="detail-card"> |
|
|
|
<div class="detail-item"> |
|
|
|
|
|
|
|
<div class="detail-content"> |
|
|
|
<span class="detail-label">物资名称</span> |
|
|
|
<span class="detail-value">{{ currentRow.materialName || '--' }}</span> |
|
|
|
<span class="detail-value">{{ |
|
|
|
currentRow.materialName || "--" |
|
|
|
}}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="detail-item"> |
|
|
|
|
|
|
|
<div class="detail-content"> |
|
|
|
<span class="detail-label">负责人</span> |
|
|
|
<span class="detail-value">{{ currentRow.personName || '--' }}</span> |
|
|
|
<span class="detail-value">{{ |
|
|
|
currentRow.personName || "--" |
|
|
|
}}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="detail-item"> |
|
|
|
|
|
|
|
<div class="detail-content"> |
|
|
|
<span class="detail-label">负责人电话</span> |
|
|
|
<span class="detail-value">{{ currentRow.personPhone || '--' }}</span> |
|
|
|
<span class="detail-value">{{ |
|
|
|
currentRow.personPhone || "--" |
|
|
|
}}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="detail-item conclusion-item"> |
|
|
|
|
|
|
|
<div class="detail-content"> |
|
|
|
<span class="detail-label">负责人职务</span> |
|
|
|
<div class="detail-value">{{ currentRow.personLevel || '--' }}</div> |
|
|
|
<div class="detail-value"> |
|
|
|
{{ currentRow.personLevel || "--" }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="detail-item conclusion-item"> |
|
|
|
|
|
|
|
<div class="detail-content"> |
|
|
|
<span class="detail-label">物资数量</span> |
|
|
|
<div class="detail-value">{{ currentRow.materialNumber || '--' }}</div> |
|
|
|
<div class="detail-value"> |
|
|
|
{{ currentRow.materialNumber || "--" }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="detail-item conclusion-item"> |
|
|
|
|
|
|
|
<div class="detail-content"> |
|
|
|
<span class="detail-label">采购时间</span> |
|
|
|
<div class="detail-value">{{ currentRow.procurementTime || '--' }}</div> |
|
|
|
<div class="detail-value"> |
|
|
|
{{ currentRow.procurementTime || "--" }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="detail-item conclusion-item"> |
|
|
|
|
|
|
|
<div class="detail-content"> |
|
|
|
<span class="detail-label">物资种类</span> |
|
|
|
<div class="detail-value">{{ projTypeFormat(currentRow.materialType) || '--' }}</div> |
|
|
|
<div class="detail-value"> |
|
|
|
{{ projTypeFormat(currentRow.materialType) || "--" }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="detail-item conclusion-item"> |
|
|
|
|
|
|
|
<div class="detail-content"> |
|
|
|
<span class="detail-label">保质期</span> |
|
|
|
<div class="detail-value">{{ currentRow.shelfLife || '--' }}</div> |
|
|
|
<div class="detail-value"> |
|
|
|
{{ currentRow.shelfLife || "--" }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="modern-dialog-footer"> |
|
|
|
<el-button class="close-button" @click="dialogVisible = false">关闭</el-button> |
|
|
|
<el-button class="close-button" @click="dialogVisible = false" |
|
|
|
>关闭</el-button |
|
|
|
> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</Transition> |
|
|
|
</Teleport> |
|
|
|
<!-- <el-dialog--> |
|
|
|
<!-- v-model="dialogVisible"--> |
|
|
|
<!-- title="物资详情"--> |
|
|
|
<!-- width="50%"--> |
|
|
|
<!-- :before-close="handleDialogClose"--> |
|
|
|
<!-- >--> |
|
|
|
<!-- <div class="detail-container">--> |
|
|
|
<!-- <div class="detail-item">--> |
|
|
|
<!-- <span class="detail-label">物资名称:</span>--> |
|
|
|
<!-- <span class="detail-value">{{ currentRow.materialName || '--' }}</span>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- <div class="detail-item">--> |
|
|
|
<!-- <span class="detail-label">物资数量:</span>--> |
|
|
|
<!-- <span class="detail-value">{{ currentRow.materialNumber || '--' }}</span>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- <div class="detail-item">--> |
|
|
|
<!-- <span class="detail-label">物资类型:</span>--> |
|
|
|
<!-- <span class="detail-value">{{ projTypeFormat(currentRow.materialType) || '--' }}</span>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- <div class="detail-item">--> |
|
|
|
<!-- <span class="detail-label">采购时间:</span>--> |
|
|
|
<!-- <span class="detail-value">{{ currentRow.procurementTime || '--' }}</span>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- <div class="detail-item">--> |
|
|
|
<!-- <span class="detail-label">负责人:</span>--> |
|
|
|
<!-- <span class="detail-value">{{ currentRow.personName || '--' }}</span>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- <template #footer>--> |
|
|
|
<!-- <div class="dialog-footer">--> |
|
|
|
<!-- <el-button @click="dialogVisible = false">关闭</el-button>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-dialog>--> |
|
|
|
<!-- <el-dialog--> |
|
|
|
<!-- v-model="dialogVisible"--> |
|
|
|
<!-- title="物资详情"--> |
|
|
|
<!-- width="50%"--> |
|
|
|
<!-- :before-close="handleDialogClose"--> |
|
|
|
<!-- >--> |
|
|
|
<!-- <div class="detail-container">--> |
|
|
|
<!-- <div class="detail-item">--> |
|
|
|
<!-- <span class="detail-label">物资名称:</span>--> |
|
|
|
<!-- <span class="detail-value">{{ currentRow.materialName || '--' }}</span>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- <div class="detail-item">--> |
|
|
|
<!-- <span class="detail-label">物资数量:</span>--> |
|
|
|
<!-- <span class="detail-value">{{ currentRow.materialNumber || '--' }}</span>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- <div class="detail-item">--> |
|
|
|
<!-- <span class="detail-label">物资类型:</span>--> |
|
|
|
<!-- <span class="detail-value">{{ projTypeFormat(currentRow.materialType) || '--' }}</span>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- <div class="detail-item">--> |
|
|
|
<!-- <span class="detail-label">采购时间:</span>--> |
|
|
|
<!-- <span class="detail-value">{{ currentRow.procurementTime || '--' }}</span>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- <div class="detail-item">--> |
|
|
|
<!-- <span class="detail-label">负责人:</span>--> |
|
|
|
<!-- <span class="detail-value">{{ currentRow.personName || '--' }}</span>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- <template #footer>--> |
|
|
|
<!-- <div class="dialog-footer">--> |
|
|
|
<!-- <el-button @click="dialogVisible = false">关闭</el-button>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-dialog>--> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import {ref, onMounted, watch, reactive} from 'vue'; |
|
|
|
import type { PropType } from 'vue'; |
|
|
|
import {listAqjdxx, listFzwz} from "~/api/dike"; |
|
|
|
import {getDictLabel} from "~/utils/dictUtils"; |
|
|
|
import {getDicts} from "~/api/common"; |
|
|
|
import { ref, onMounted, watch, reactive } from "vue"; |
|
|
|
import type { PropType } from "vue"; |
|
|
|
import { listAqjdxx, listFzwz } from "~/api/dike"; |
|
|
|
import { getDictLabel } from "~/utils/dictUtils"; |
|
|
|
import { getDicts } from "~/api/common"; |
|
|
|
const handleOverlayClick = (e: MouseEvent) => { |
|
|
|
dialogVisible.value = false; |
|
|
|
}; |
|
|
|
const props = defineProps({ |
|
|
|
resCode: { |
|
|
|
type: String as PropType<string> |
|
|
|
type: String as PropType<string>, |
|
|
|
}, |
|
|
|
}); |
|
|
|
const dateRange = ref([]); |
|
|
|
const materialName = ref(''); |
|
|
|
const responsiblePerson = ref(''); |
|
|
|
const procurementTime=ref(null) |
|
|
|
const materialName = ref(""); |
|
|
|
const responsiblePerson = ref(""); |
|
|
|
const procurementTime = ref(null); |
|
|
|
// Dialog visibility |
|
|
|
const dialogVisible = ref(false); |
|
|
|
|
|
|
|
// Current row being viewed |
|
|
|
const currentRow = reactive({ |
|
|
|
materialName: '', |
|
|
|
materialNumber: '', |
|
|
|
personLevel:'', |
|
|
|
personPhone:'', |
|
|
|
shelfLife:'', |
|
|
|
materialType: '', |
|
|
|
procurementTime: '', |
|
|
|
personName: '' |
|
|
|
materialName: "", |
|
|
|
materialNumber: "", |
|
|
|
personLevel: "", |
|
|
|
personPhone: "", |
|
|
|
shelfLife: "", |
|
|
|
materialType: "", |
|
|
|
procurementTime: "", |
|
|
|
personName: "", |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const handleReset = () => { |
|
|
|
procurementTime.value = null; |
|
|
|
materialName.value = ''; |
|
|
|
responsiblePerson.value = ''; |
|
|
|
materialName.value = ""; |
|
|
|
responsiblePerson.value = ""; |
|
|
|
initFxwz(); |
|
|
|
}; |
|
|
|
|
|
|
|
// View function |
|
|
|
const handleView = (row: any) => { |
|
|
|
console.log('View row:', row); |
|
|
|
console.log("View row:", row); |
|
|
|
|
|
|
|
// Copy row data to currentRow |
|
|
|
currentRow.materialName = row.materialName || ''; |
|
|
|
currentRow.materialNumber = row.materialNumber || ''; |
|
|
|
currentRow.materialType = row.materialType || ''; |
|
|
|
currentRow.procurementTime = row.procurementTime || ''; |
|
|
|
currentRow.personName = row.personName || ''; |
|
|
|
currentRow.personPhone=row.personPhone||'', |
|
|
|
currentRow.personLevel=row.personLevel||'', |
|
|
|
currentRow.shelfLife=row.shelfLife||'' |
|
|
|
|
|
|
|
currentRow.materialName = row.materialName || ""; |
|
|
|
currentRow.materialNumber = row.materialNumber || ""; |
|
|
|
currentRow.materialType = row.materialType || ""; |
|
|
|
currentRow.procurementTime = row.procurementTime || ""; |
|
|
|
currentRow.personName = row.personName || ""; |
|
|
|
(currentRow.personPhone = row.personPhone || ""), |
|
|
|
(currentRow.personLevel = row.personLevel || ""), |
|
|
|
(currentRow.shelfLife = row.shelfLife || ""); |
|
|
|
|
|
|
|
// Show dialog |
|
|
|
dialogVisible.value = true; |
|
|
|
}; |
|
|
|
const typesMaterials=ref([]) |
|
|
|
const typesMaterials = ref([]); |
|
|
|
// Handle dialog close |
|
|
|
const handleDialogClose = () => { |
|
|
|
dialogVisible.value = false; |
|
|
@ -242,11 +282,11 @@ const handleDialogClose = () => { |
|
|
|
function getType() { |
|
|
|
getDicts("types_materials").then((res) => { |
|
|
|
typesMaterials.value = res || []; |
|
|
|
console.log(typesMaterials.value,'11111') |
|
|
|
console.log(typesMaterials.value, "11111"); |
|
|
|
}); |
|
|
|
} |
|
|
|
function projTypeFormat(key: string) { |
|
|
|
if (!key) return '--'; |
|
|
|
if (!key) return "--"; |
|
|
|
return getDictLabel(typesMaterials.value, key) || key; |
|
|
|
} |
|
|
|
|
|
|
@ -262,31 +302,27 @@ const searchDate = ref([]); |
|
|
|
|
|
|
|
// View function |
|
|
|
|
|
|
|
|
|
|
|
// Fetch data based on resCode changes |
|
|
|
watch( |
|
|
|
() => props.resCode, |
|
|
|
(newVal) => { |
|
|
|
if (newVal) { |
|
|
|
fetchSafetyData(); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ immediate: true } |
|
|
|
); |
|
|
|
|
|
|
|
// Fetch safety appraisal data |
|
|
|
const fetchSafetyData = async () => { |
|
|
|
|
|
|
|
}; |
|
|
|
// const fetchSafetyData = async () => {}; |
|
|
|
|
|
|
|
// // Fetch data based on resCode changes |
|
|
|
// watch( |
|
|
|
// () => props.resCode, |
|
|
|
// (newVal) => { |
|
|
|
// if (newVal) { |
|
|
|
// fetchSafetyData(); |
|
|
|
// } |
|
|
|
// }, |
|
|
|
// { immediate: true } |
|
|
|
// ); |
|
|
|
|
|
|
|
function initFxwz() { |
|
|
|
|
|
|
|
const requestData: any = { |
|
|
|
dikeCode: props.resCode, |
|
|
|
}; |
|
|
|
|
|
|
|
if (procurementTime.value){ |
|
|
|
requestData.procurementTime=procurementTime.value; |
|
|
|
if (procurementTime.value) { |
|
|
|
requestData.procurementTime = procurementTime.value; |
|
|
|
} |
|
|
|
// Add search parameters if they exist |
|
|
|
if (materialName.value) { |
|
|
@ -302,11 +338,10 @@ function initFxwz() { |
|
|
|
listFzwz({ |
|
|
|
page: 1, |
|
|
|
pageSize: 10, |
|
|
|
data:requestData |
|
|
|
|
|
|
|
data: requestData, |
|
|
|
}).then((res) => { |
|
|
|
if (res) { |
|
|
|
tableData.value=res.records || []; |
|
|
|
tableData.value = res.records || []; |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
@ -397,7 +432,9 @@ onMounted(() => { |
|
|
|
|
|
|
|
.dialog-fade-enter-active, |
|
|
|
.dialog-fade-leave-active { |
|
|
|
transition: opacity 0.3s ease, transform 0.3s ease; |
|
|
|
transition: |
|
|
|
opacity 0.3s ease, |
|
|
|
transform 0.3s ease; |
|
|
|
} |
|
|
|
|
|
|
|
.dialog-fade-enter-from, |
|
|
@ -509,7 +546,9 @@ onMounted(() => { |
|
|
|
margin-bottom: 5px; |
|
|
|
padding-bottom: 5px; |
|
|
|
border-bottom: 1px solid rgba(0, 0, 0, 0.06); |
|
|
|
transition: transform 0.2s, box-shadow 0.2s; |
|
|
|
transition: |
|
|
|
transform 0.2s, |
|
|
|
box-shadow 0.2s; |
|
|
|
|
|
|
|
&:last-child { |
|
|
|
margin-bottom: 0; |
|
|
@ -575,14 +614,16 @@ onMounted(() => { |
|
|
|
border-top: 1px solid #e9ecef; |
|
|
|
|
|
|
|
.close-button { |
|
|
|
background: linear-gradient(135deg, #2C7EF8 0%, #2C5EF8 100%); |
|
|
|
background: linear-gradient(135deg, #2c7ef8 0%, #2c5ef8 100%); |
|
|
|
border: none; |
|
|
|
color: white; |
|
|
|
padding: 10px 24px; |
|
|
|
border-radius: 6px; |
|
|
|
font-weight: 500; |
|
|
|
cursor: pointer; |
|
|
|
transition: transform 0.15s, box-shadow 0.15s; |
|
|
|
transition: |
|
|
|
transform 0.15s, |
|
|
|
box-shadow 0.15s; |
|
|
|
|
|
|
|
&:hover { |
|
|
|
transform: translateY(-2px); |
|
|
|