Commit e08e9fb6 authored by ZhangRunSong's avatar ZhangRunSong

feat:物资归还

parent 5b8dae86
import request from '@/utils/request'
// 查询物品归还申请列表
export function listReturn(query) {
return request({
url: '/material/return/list',
method: 'get',
params: query
})
}
// 查询物品归还申请详细
export function getReturn(id) {
return request({
url: '/material/return/' + id,
method: 'get'
})
}
// 新增物品归还申请
export function addReturn(data) {
return request({
url: '/material/return',
method: 'post',
data: data
})
}
// 修改物品归还申请
export function updateReturn(data) {
return request({
url: '/material/return',
method: 'put',
data: data
})
}
// 删除物品归还申请
export function delReturn(id) {
return request({
url: '/material/return/' + id,
method: 'delete'
})
}
......@@ -44,15 +44,15 @@
</template>
查询
</el-button>
<el-button size="large" type="text" @click="toggleSearch">
<!-- <el-button size="large" type="text" @click="toggleSearch">
{{ isExpanded ? ' 收起' : ' 展开' }}
<el-icon class="el-icon--right">
<el-icon class="el-icon&#45;&#45;right">
<arrow-down />
</el-icon>
</el-button>
</el-button>-->
</el-form-item>
<!-- 可折叠的查询条件 -->
<transition>
<!-- <transition>
<div v-if="isExpanded">
<el-form-item label="申请时间" prop="createTime" style="width: 320px ;margin-top: 20px">
<el-date-picker clearable
......@@ -64,7 +64,7 @@
</el-form-item>
</div>
</transition>
</transition>-->
</el-form>
</div>
<div class="contentTable">
......@@ -117,7 +117,7 @@
<el-button type="text">物品明细</el-button>
</template>
<el-table :data="scope.row.items" border style="width: 100%">
<!-- 项目回款笔数 -->
<el-table-column label="物品类型" align="center">
<template #default="scope">
{{ typeMap[scope.row.type] || '-' }}
......@@ -163,13 +163,8 @@
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" min-width="70">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" min-width="50">
<template #default="scope">
<el-tooltip content="编辑" placement="top">
<el-button link type="text" @click="handleUpdate(scope.row)" v-hasPermi="['material:apply:edit']">
<img src="../../assets/icons/common/edit.png" height="32" width="32"/>
</el-button>
</el-tooltip>
<el-tooltip content="详情" placement="top">
<el-button link type="text" @click="handleView(scope.row)" v-hasPermi="['system:project:view']">
<img src="../../assets/icons/common/check.png" height="32" width="32"/>
......@@ -286,11 +281,7 @@ const materialDetailMap = computed(() => {
});
return map;
});
// 取消按钮
function cancel() {
open.value = false;
reset();
}
// 表单重置
function reset() {
......
This diff is collapsed.
This diff is collapsed.
<template>
<div class="app-container">
<div class="content" style="position: relative">
<div style="padding-left: 15px ;padding-top: 15px">
<span class="bold-text" style="border-bottom: 3px solid blue;">借用详情</span>
</div>
<div style="padding-top: 28px ;padding-left: 10px; ">
<el-form :model="form" label-width="auto">
<el-row>
<el-col :span="2">
<label class="label-title">项目名称:</label>
</el-col>
<el-col :span="2">
<span class="label">
{{ project_list.find(item => item.id === form.projectId)?.projectName || '未知类型' }}
</span>
</el-col>
</el-row>
<el-row>
<el-col :span="2">
<label class="label-title">申请人:</label>
</el-col>
<el-col :span="2">
<span class="label">
{{form.userName}}
</span>
</el-col>
</el-row>
<el-row>
<el-col :span="2">
<label class="label-title">申请时间:</label>
</el-col>
<el-col :span="5">
<span class="label">
{{ parseTime(form.createTime, '{y}-{m}-{d} {h}:{i}') }}
</span>
</el-col>
</el-row>
<el-row>
<el-col :span="2">
<label class="label-title">审批状态:</label>
</el-col>
<el-col :span="2">
<template v-for="(item, index) in material_status" :key="index">
<span class="label" v-if="item.value === form.checkStatus">
{{ item.label }}
</span>
</template>
</el-col>
</el-row>
<el-row>
<el-col :span="2">
<label class="label-title">申请备注:</label>
</el-col>
<el-col :span="15">
<span class="label">
{{ form.remark }}
</span>
</el-col>
</el-row>
<el-row>
<el-col :span="2">
<label class="label-title">申请物品:</label>
</el-col>
<el-col :span="20">
<div v-for="(item, index) in form.items" :key="index" class="item-row" style="display: flex; gap: 30px">
<span style="flex: 1; min-width: 120px" class="label">物品类型:{{ material_type.find(m => m.id === item.type)?.typeName || '—' }}</span>
<span style="flex: 1; min-width: 120px" class="label" >物品名称:{{ all_material_type_detail.find(d => d.id === item.material_detail)?.materialName || '—' }}</span>
<span style="flex: 1; min-width: 120px" class="label" >申请数量:{{ item.quantity || 0 }}</span>
</div>
</el-col>
</el-row>
</el-form>
<div style="position: absolute;right: 52px;bottom: 42px">
<el-button type="primary" size="large" class="btn-A" @click="reset">返回</el-button>
</div>
</div>
</div>
</div>
</template>
<script setup>
import {getReturn} from "../../api/material/return.js";
import { listProject} from "../../api/project/project.js";
import {listMaterialType,listMaterialTypeDetail} from "../../api/material/material.js";
const { proxy } = getCurrentInstance();
const {material_status } = proxy.useDict('material_status');
const project_list = ref([]);
const all_material_type_detail = ref([]);
const material_type = ref([]);
const form = ref({
id: null,
projectId: null,
userId: null,
userName: null,
checkStatus: null,
remark: null,
createBy: null,
createTime: null,
items: [{
type: null,
material_detail: null,
quantity: null
}],
})
// 格式化日期
/*function formatDate(date) {
if (!date) return '-';
const d = new Date(date);
return `${d.getFullYear()}/${String(d.getMonth() + 1).padStart(2, '0')}/${String(d.getDate()).padStart(2, '0')}`;
}*/
// 返回项目管理页面
const reset = () => {
// 返回项目
proxy.$router.push({ path: '/material/materialReturn' })
}
/** 根据ID查到的详细信息 */
const getInfo = () =>{
getReturn(proxy.$route.query.id).then(response=>{
form.value = response.data;
})
}
/** 获取项目列表 */
function getProjectList(){
listProject().then(response =>{
project_list.value = response.rows;
console.log("project_list:",project_list.value)
})
}
/** 获取物品类型 */
function getTypeList() {
listMaterialType().then(response => {
material_type.value = response.data;
});
}
/** 获取类型的物品列表 */
function getTypeDetailList(){
listMaterialTypeDetail().then(response => {
all_material_type_detail.value = response.data;
});
}
onMounted(() => {
//根据id查询信息
getInfo();
//获取项目列表
getProjectList();
//获取物品类型
getTypeList();
//获取物品信息
getTypeDetailList();
})
</script>
<style scoped lang="scss">
.bold-text {
width: 72px;
height: 15px;
font-family: PingFangSC-Medium;
font-weight: 900;
font-size: 18px;
color: #0D162A;
letter-spacing: 0;
line-height: 15px;
}
.label-title {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 19px;
color: #666666;
letter-spacing: 0;
//text-align: right;
line-height: 40px;
}
.bordered {
margin-left: 110px;
padding: 20px;
background: #FAFAFA;
border: 1px solid #C8CEDE;
border-radius: 2px;
//min-height: 200px;
}
.label {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 19px;
color: #4A4E54;
letter-spacing: 0;
line-height: 40px;
}
.file-item {
display: block;
margin: 9px 0;
}
.file-item .el-link {
font-size: 18px;
}
.table-container {
display: flex;
justify-content: center;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment