提交 04845f67 编写于 作者: 刘英杰's avatar 刘英杰

初版

上级 b503bf98
流水线 #35273 已通过 ,包含阶段
in 2 minute 和 30 second

要显示的变更太多。

为了保持性能,仅显示文件中的 1000/1000+。

<script setup>
</script>
<template>
</template>
<style scoped>
</style>
\ No newline at end of file
<template>
<!-- 审批详情 -->
<Drawer v-model="init.auditList.drawer.show" width="100%" :styles="{padding: '16px 0px 0px 0px'}" title="审批信息">
<div class="drawer-content">
<Card class="approval-card">
<Form :model="init.auditList.drawer.formData" :label-width="120">
<h3>耗材信息</h3>
<Divider></Divider>
<Table
:columns="init.auditList.drawer.columns"
:data="init.auditList.drawer.dataItem.application_list_response.materials"
border
size="small"
style="margin: 8px 0px;"
v-if="init.auditList.drawer.dataItem.application_list_response.materials && init.auditList.drawer.dataItem.application_list_response.materials.length"
>
</Table>
<h3>申请信息</h3>
<Divider></Divider>
<Row>
<Col v-bind="init.grid" class="approval-col">
<FormItem label="申请人">
<span>{{ init.auditList.drawer.dataItem?.application_list_response?.create_name || '-' }}</span>
</FormItem>
</Col>
<Col v-bind="init.grid" class="approval-col">
<FormItem label="申请人工号">
<span>{{ init.auditList.drawer.dataItem?.application_list_response?.create_card || '-' }}</span>
</FormItem>
</Col>
<Col v-bind="init.grid" class="approval-col">
<FormItem label="申请部门">
<span>{{ init.auditList.drawer.dataItem?.application_list_response?.dept_name || '-' }}</span>
</FormItem>
</Col>
<Col v-bind="init.grid" class="approval-col">
<FormItem label="申请时间">
<span>{{ init.auditList.drawer.dataItem?.application_list_response?.createtime || '-' }}</span>
</FormItem>
</Col>
<Col v-bind="init.grid" class="approval-col">
<FormItem label="耗材名称">
<span>
<template
v-if="init.auditList.drawer.dataItem?.application_list_response?.materials && init.auditList.drawer.dataItem.application_list_response.materials.length">
{{ init.auditList.drawer.dataItem.application_list_response.materials.map(m => m.material_name).join(',') }}
</template>
<template v-else>-</template>
</span>
</FormItem>
</Col>
<Col v-bind="init.grid" class="approval-col">
<FormItem label="耗材分类">
<span>
<template
v-if="init.auditList.drawer.dataItem?.application_list_response?.materials && init.auditList.drawer.dataItem.application_list_response.materials.length">
{{ init.auditList.drawer.dataItem.application_list_response.materials.map(m => m.classification_name).join(',') }}
</template>
<template v-else>-</template>
</span>
</FormItem>
</Col>
<Col v-bind="init.grid" class="approval-col">
<FormItem label="申请数量">
<span>
<template
v-if="init.auditList.drawer.dataItem?.application_list_response?.materials && init.auditList.drawer.dataItem.application_list_response.materials.length">
{{ init.auditList.drawer.dataItem.application_list_response.materials.map(m => m.apply_num).join(',') }}
</template>
<template v-else>-</template>
</span>
</FormItem>
</Col>
<Col v-bind="init.grid" class="approval-col">
<FormItem label="当前库存">
<span>
<template
v-if="init.auditList.drawer.dataItem?.application_list_response?.materials && init.auditList.drawer.dataItem.application_list_response.materials.length">
{{ init.auditList.drawer.dataItem.application_list_response.materials.map(m => m.current_stock).join(',') }}
</template>
<template v-else>-</template>
</span>
</FormItem>
</Col>
<Col v-bind="init.grid" class="approval-col">
<FormItem label="安全库存">
<span>
<template
v-if="init.auditList.drawer.dataItem?.application_list_response?.materials && init.auditList.drawer.dataItem.application_list_response.materials.length">
{{ init.auditList.drawer.dataItem.application_list_response.materials.map(m => m.safety_stock).join(',') }}
</template>
<template v-else>-</template>
</span>
</FormItem>
</Col>
<Col v-bind="init.grid" class="approval-col">
<FormItem label="人均限领">
<span>
<template
v-if="init.auditList.drawer.dataItem?.application_list_response?.materials && init.auditList.drawer.dataItem.application_list_response.materials.length">
{{ init.auditList.drawer.dataItem.application_list_response.materials.map(m => m.person_limit).join(',') }}
</template>
<template v-else>-</template>
</span>
</FormItem>
</Col>
<Col v-bind="init.grid" class="approval-col">
<FormItem label="申请用途">
<span>{{ init.auditList.drawer.dataItem?.application_list_response?.usage || '-' }}</span>
</FormItem>
</Col>
<Col v-bind="init.grid" class="approval-col">
<FormItem label="申请原因">
<span>{{ init.auditList.drawer.dataItem?.application_list_response?.reason || '-' }}</span>
</FormItem>
</Col>
<Col v-bind="init.grid" class="approval-col">
<FormItem label="计划开始时间">
<span>{{ init.auditList.drawer.dataItem?.application_list_response?.plan_start_date || '-' }}</span>
</FormItem>
</Col>
<Col v-bind="init.grid" class="approval-col">
<FormItem label="预计归还时间">
<span>{{ init.auditList.drawer.dataItem?.application_list_response?.plan_end_date || '-' }}</span>
</FormItem>
</Col>
<Col v-bind="init.grid" class="approval-col">
<FormItem label="审核节点">
<span>{{ init.auditList.drawer.dataItem?.node_name || '-' }}</span>
</FormItem>
</Col>
<Col v-bind="init.grid" class="approval-col">
<FormItem label="审核状态">
<Tag v-if="init.auditList.drawer.dataItem?.application_list_response?.audit_status === 0"
color="primary">审核中
</Tag>
<Tag v-else-if="init.auditList.drawer.dataItem?.application_list_response?.audit_status === 1"
color="success">通过
</Tag>
<Tag v-else-if="init.auditList.drawer.dataItem?.application_list_response?.audit_status === 2"
color="error">未通过
</Tag>
<Tag v-else>-</Tag>
</FormItem>
</Col>
<Col v-bind="init.grid" class="approval-col">
<FormItem label="备注说明">
<span>{{ init.auditList.drawer.dataItem?.application_list_response?.remark || '-' }}</span>
</FormItem>
</Col>
<Col v-bind="init.grid" class="approval-col">
<FormItem label="附件">
<viewer
:images="(init.auditList.drawer.dataItem?.application_list_response?.file_list || []).filter(cur=>caseFileType(cur.extension) === 'image')">
<img
v-for="(imgItem, imgIndex) in (init.auditList.drawer.dataItem?.application_list_response?.file_list || []).filter(cur=>caseFileType(cur.extension) === 'image')"
:key="imgIndex" class="previewImg" :src="imgItem.path" alt=""/>
</viewer>
<p class="file-cell"
v-for="(fileItem, fileIndex) in (init.auditList.drawer.dataItem?.application_list_response?.file_list || []).filter(cur=>caseFileType(cur.extension) !== 'image')"
:key="fileIndex">
<img src="@/assets/images/通用文件.png" style="min-width: 15px; height: 15px; margin-right: 8px"/>
<span class="file-name" @click="handlePreviewFile(fileItem)">{{ fileItem.name }}</span>
</p>
</FormItem>
</Col>
</Row>
</Form>
</Card>
</div>
<div class="drawer-footer">
<div class="action-btns">
<Button
v-if="init.auditList.drawer.dataItem?.actions && init.auditList.drawer.dataItem.actions.includes('pass')"
type="primary"
style="margin-right: 10px"
@click="handleApprove(init.auditList.drawer.dataItem,'pass')"
>通过
</Button>
<Button
v-if="init.auditList.drawer.dataItem?.actions && init.auditList.drawer.dataItem.actions.includes('refuse')"
type="error"
style="margin-right: 10px"
@click="handleApprove(init.auditList.drawer.dataItem,'refuse')"
>不通过
</Button>
<Button @click="init.auditList.drawer.show =false">关闭</Button>
</div>
</div>
</Drawer>
</template>
<script setup>
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<!-- 审批详情 -->
<Drawer v-model="init.drawer.show" width="100%" :styles="{padding: '16px 0px 0px 0px'}" title="审批信息">
<div class="drawer-content">
<Card class="approval-card">
<Form :label-width="120">
<div v-for="(item,index) in dataArray" :key="index">
<div v-if="item.type === 'table'">
<h3>{{item.title}}</h3>
<Divider></Divider>
<Table
:columns="item.columns"
:data="item.value"
border
size="small"
style="margin: 8px 0px;"
v-if="item.data && item.data.length"
>
</Table>
</div>
<div v-else-if="item.type !== 'table'">
<h3>基本信息</h3>
<Divider></Divider>
<Row>
<Col v-if="item.type == 'text'" v-bind="init.grid" class="approval-col">
<FormItem :label="item.label">
<span>{{ item.value || '-' }}</span>
</FormItem>
</Col>
<Col v-if="item.type == 'tag'" v-bind="init.grid" class="approval-col">
<FormItem :label="item.label">
<Tag :color="[item.color][item.value]">[item.dict][item.value]</Tag>
</FormItem>
</Col>
<Col v-if="item.type == 'file'" v-bind="init.grid" class="approval-col">
<FormItem label="附件">
<viewer
:images="(item.value || []).filter(cur=>caseFileType(cur.extension) === 'image')">
<img
v-for="(imgItem, imgIndex) in (item.value || []).filter(cur=>caseFileType(cur.extension) === 'image')"
:key="imgIndex" class="previewImg" :src="imgItem.path" alt=""/>
</viewer>
<p class="file-cell"
v-for="(fileItem, fileIndex) in (item.value || []).filter(cur=>caseFileType(cur.extension) !== 'image')"
:key="fileIndex">
<img src="@/assets/images/通用文件.png" style="min-width: 15px; height: 15px; margin-right: 8px"/>
<span class="file-name" @click="handlePreviewFile(fileItem)">{{ fileItem.name }}</span>
</p>
</FormItem>
</Col>
</Row>
</div>
</div>
</Form>
</Card>
</div>
<div class="drawer-footer">
<div class="action-btns">
<slot name="footer"></slot>
<Button @click="init.drawer.show =false">关闭</Button>
</div>
</div>
</Drawer>
</template>
<script setup>
import {
Card,
Divider,
Drawer,
FormItem,
InputNumber,
Message,
Modal,
Modal as ModalConfirm,
Page,
Row,
Tag
} from 'view-ui-plus'
import {reactive} from "vue";
defineProps({
dataArray: {
type: Array,
default: () => []
}
})
defineEmits(['close'])
const init = reactive({
grid: {
xs: 24,
sm: 12,
md: 12,
lg: 12,
},
drawer:{
show:true,
}
})
//附件类型判定
function caseFileType(type){
let returnType = '';
switch (type) {
case '.png':
returnType = 'image'
break;
case '.jpeg':
returnType = 'image'
break;
case '.jpg':
returnType = 'image'
break;
default:
returnType = 'otherFile'
}
return returnType;
}
//附件下载
function handlePreviewFile(row) {
console.log(row)
window.location.href = window.location.origin + row.path
}
defineExpose({
show:init.drawer.show
})
</script>
<style scoped lang="less">
.drawer-content {
width: 100%;
height: calc(100% - 60px);
display: flex;
justify-content: center;
overflow: auto;
}
.approval-card {
height: fit-content;
width: 60%;
margin-bottom: 50px;
}
.approval-col {
display: flex;
}
.drawer-footer {
width: 100%;
height: 60px;
}
.action-btns {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 60px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
/deep/ .ivu-divider-horizontal {
display: block;
height: 1px;
width: 100%;
min-width: 100%;
margin: 13px 0;
clear: both;
}
.previewImg {
width: 80px;
height: 80px;
cursor: pointer;
margin-right: 15px;
}
.file-cell {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 0;
color: #1989f9;
cursor: pointer;
.file-delete-icon {
width: 20px;
height: 24px;
line-height: 24px;
background: #d6d6d6;
border-radius: 5px;
text-align: center;
color: #fff;
margin-left: 25px;
cursor: pointer;
}
.file-name {
flex: 1;
word-break: break-all;
}
}
</style>
\ No newline at end of file
<template>
<!-- 审批详情 -->
<Drawer v-model="init.drawer.show" width="100%" :styles="{padding: '16px 0px 0px 0px'}" title="审批信息">
<div class="drawer-content">
<Card class="approval-card">
<Form :label-width="120">
<div v-for="(item,index) in dataArray" :key="index">
<div v-if="item.type === 'table'">
<h3>{{item.title}}</h3>
<Divider></Divider>
<Table
:columns="item.columns"
:data="item.value"
border
size="small"
style="margin: 8px 0px;"
v-if="item.data && item.data.length"
>
</Table>
</div>
<div v-else-if="item.type !== 'table'">
<h3>基本信息</h3>
<Divider></Divider>
<Row>
<Col v-if="item.type == 'text'" v-bind="init.grid" class="approval-col">
<FormItem :label="item.label">
<span>{{ item.value || '-' }}</span>
</FormItem>
</Col>
<Col v-if="item.type == 'tag'" v-bind="init.grid" class="approval-col">
<FormItem :label="item.label">
<Tag :color="[item.color][item.value]">[item.dict][item.value]</Tag>
</FormItem>
</Col>
<Col v-if="item.type == 'file'" v-bind="init.grid" class="approval-col">
<FormItem label="附件">
<viewer
:images="(item.value || []).filter(cur=>caseFileType(cur.extension) === 'image')">
<img
v-for="(imgItem, imgIndex) in (item.value || []).filter(cur=>caseFileType(cur.extension) === 'image')"
:key="imgIndex" class="previewImg" :src="imgItem.path" alt=""/>
</viewer>
<p class="file-cell"
v-for="(fileItem, fileIndex) in (item.value || []).filter(cur=>caseFileType(cur.extension) !== 'image')"
:key="fileIndex">
<img src="@/assets/images/通用文件.png" style="min-width: 15px; height: 15px; margin-right: 8px"/>
<span class="file-name" @click="handlePreviewFile(fileItem)">{{ fileItem.name }}</span>
</p>
</FormItem>
</Col>
</Row>
</div>
</div>
</Form>
</Card>
</div>
<div class="drawer-footer">
<div class="action-btns">
<slot name="footer"></slot>
<Button @click="init.drawer.show =false">关闭</Button>
</div>
</div>
</Drawer>
</template>
<script setup>
import {
Card,
Divider,
Drawer,
FormItem,
InputNumber,
Message,
Modal,
Modal as ModalConfirm,
Page,
Row,
Tag
} from 'view-ui-plus'
import {reactive} from "vue";
defineProps({
dataArray: {
type: Array,
default: () => []
}
})
defineEmits(['close'])
const init = reactive({
grid: {
xs: 24,
sm: 12,
md: 12,
lg: 12,
},
drawer:{
show:true,
}
})
//附件类型判定
function caseFileType(type){
let returnType = '';
switch (type) {
case '.png':
returnType = 'image'
break;
case '.jpeg':
returnType = 'image'
break;
case '.jpg':
returnType = 'image'
break;
default:
returnType = 'otherFile'
}
return returnType;
}
//附件下载
function handlePreviewFile(row) {
console.log(row)
window.location.href = window.location.origin + row.path
}
defineExpose({
show:init.drawer.show
})
</script>
<style scoped lang="less">
.drawer-content {
width: 100%;
height: calc(100% - 60px);
display: flex;
justify-content: center;
overflow: auto;
}
.approval-card {
height: fit-content;
width: 60%;
margin-bottom: 50px;
}
.approval-col {
display: flex;
}
.drawer-footer {
width: 100%;
height: 60px;
}
.action-btns {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 60px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
/deep/ .ivu-divider-horizontal {
display: block;
height: 1px;
width: 100%;
min-width: 100%;
margin: 13px 0;
clear: both;
}
.previewImg {
width: 80px;
height: 80px;
cursor: pointer;
margin-right: 15px;
}
.file-cell {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 0;
color: #1989f9;
cursor: pointer;
.file-delete-icon {
width: 20px;
height: 24px;
line-height: 24px;
background: #d6d6d6;
border-radius: 5px;
text-align: center;
color: #fff;
margin-left: 25px;
cursor: pointer;
}
.file-name {
flex: 1;
word-break: break-all;
}
}
</style>
\ No newline at end of file
<template>
<!-- 详情 -->
<Drawer v-model="show" width="100%" :styles="{padding: '16px 0px 0px 0px'}" :title="title">
<div class="drawer-content">
<Card class="approval-card">
<Form :label-width="120">
<div>
<div v-if="dataArray.filter(cur =>cur.type === 'table').length>0" v-for="(item,index) in dataArray.filter(cur =>cur.type === 'table')" :key="index">
<h3 >{{ item.label }}</h3>
<Divider></Divider>
<Table
:columns="item.columns"
:data="item.value"
border
size="small"
style="margin: 8px 0px;"
v-if="item.data && item.data.length"
>
</Table>
</div>
<h3>基本信息</h3>
<Divider></Divider>
<div v-for="(item,index) in dataArray.filter(cur=>cur.type !== 'table')" :key="index">
<Row>
<Col v-if="item.type == 'text'" v-bind="init.grid" class="approval-col">
<FormItem :label="item.label">
<span>{{ item.value || '-' }}</span>
</FormItem>
</Col>
<Col v-if="item.type == 'tag'" v-bind="init.grid" class="approval-col">
<FormItem :label="item.label">
<Tag :color="[item.color][item.value]">[item.dict][item.value]</Tag>
</FormItem>
</Col>
<Col v-if="item.type == 'file'" v-bind="init.grid" class="approval-col">
<FormItem label="附件">
<viewer
:images="(item.value || []).filter(cur=>caseFileType(cur.extension) === 'image')">
<img
v-for="(imgItem, imgIndex) in (item.value || []).filter(cur=>caseFileType(cur.extension) === 'image')"
:key="imgIndex" class="previewImg" :src="imgItem.path" alt=""/>
</viewer>
<p class="file-cell"
v-for="(fileItem, fileIndex) in (item.value || []).filter(cur=>caseFileType(cur.extension) !== 'image')"
:key="fileIndex">
<img src="@/assets/images/通用文件.png" style="min-width: 15px; height: 15px; margin-right: 8px"/>
<span class="file-name" @click="handlePreviewFile(fileItem)">{{ fileItem.name }}</span>
</p>
</FormItem>
</Col>
</Row>
</div>
</div>
</Form>
</Card>
</div>
<div class="drawer-footer">
<div class="action-btns">
<slot name="footer"></slot>
<!-- <Button @click="init.drawer.show =false">关闭</Button>-->
</div>
</div>
</Drawer>
</template>
<script setup>
import {
Card,
Divider,
Drawer,
FormItem,
InputNumber,
Message,
Modal,
Modal as ModalConfirm,
Page,
Row,
Tag
} from 'view-ui-plus'
import {reactive, ref} from "vue";
defineProps({
title: {
type: String,
default: '详情'
},
dataArray: {
type: Array,
default: () => []
}
})
defineEmits(['close'])
const show = ref(false)
const init = reactive({
grid: {
xs: 24,
sm: 12,
md: 12,
lg: 12,
},
drawer: {
show: true,
}
})
//附件类型判定
function caseFileType(type) {
let returnType = '';
switch (type) {
case '.png':
returnType = 'image'
break;
case '.jpeg':
returnType = 'image'
break;
case '.jpg':
returnType = 'image'
break;
default:
returnType = 'otherFile'
}
return returnType;
}
//附件下载
function handlePreviewFile(row) {
console.log(row)
window.location.href = window.location.origin + row.path
}
defineExpose({
show
})
</script>
<style scoped lang="less">
.drawer-content {
width: 100%;
height: calc(100% - 60px);
display: flex;
justify-content: center;
overflow: auto;
}
.approval-card {
height: fit-content;
width: 60%;
margin-bottom: 50px;
}
.approval-col {
display: flex;
}
.drawer-footer {
width: 100%;
height: 60px;
}
.action-btns {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 60px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
/deep/ .ivu-divider-horizontal {
display: block;
height: 1px;
width: 100%;
min-width: 100%;
margin: 13px 0;
clear: both;
}
.previewImg {
width: 80px;
height: 80px;
cursor: pointer;
margin-right: 15px;
}
.file-cell {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 0;
color: #1989f9;
cursor: pointer;
.file-delete-icon {
width: 20px;
height: 24px;
line-height: 24px;
background: #d6d6d6;
border-radius: 5px;
text-align: center;
color: #fff;
margin-left: 25px;
cursor: pointer;
}
.file-name {
flex: 1;
word-break: break-all;
}
}
</style>
\ No newline at end of file
<template>
<!-- 详情 -->
<Drawer v-model="show" width="100%" :styles="{padding: '16px 0px 0px 0px'}" :title="title">
<div class="drawer-content">
<Card class="approval-card">
<Form :label-width="120">
<div>
<div v-if="dataArray.filter(cur =>cur.type === 'table').length>0" v-for="(item,index) in dataArray.filter(cur =>cur.type === 'table')" :key="index">
<h3 >{{ item.label }}</h3>
<Divider></Divider>
<Table
:columns="item.columns"
:data="item.value"
border
size="small"
style="margin: 8px 0px;"
v-if="item.value && item.value.length"
>
</Table>
</div>
<h3>基本信息</h3>
<Divider></Divider>
<Row>
<!--
这里使用 v-bind="init.grid" 是为了让每个 Col 响应式地占据一定的栅格宽度。
例如:{ xs: 24, sm: 12, md: 12, lg: 12 } 表示在大部分屏幕下每行显示2列(12+12=24),
在超小屏下每行1列(24),所以会出现4列是因为有4个基本信息项时,每行显示2个,分两行。
如果你想每行只显示1个,可以把所有断点都设置为24。
如果你想每行显示3个,可以设置为8。
具体列数由 grid 的配置和数据项数量共同决定。
-->
<template v-for="(item, index) in dataArray.filter(cur => cur.type !== 'table')" :key="index">
<Col
v-if="item.type === 'text'"
v-bind="init.grid"
class="approval-col"
>
<FormItem :label="item.label">
<span>{{ item.value || '-' }}</span>
</FormItem>
</Col>
<Col
v-else-if="item.type === 'tag'"
v-bind="init.grid"
class="approval-col"
>
<FormItem :label="item.label">
<Tag :color="item.color[item.value]">{{ item.dict[item.value] }}</Tag>
</FormItem>
</Col>
<Col
v-else-if="item.type === 'file'"
v-bind="init.grid"
class="approval-col"
>
<FormItem label="附件">
<viewer
:images="(item.value || []).filter(cur => caseFileType(cur.extension) === 'image')"
>
<img
v-for="(imgItem, imgIndex) in (item.value || []).filter(cur => caseFileType(cur.extension) === 'image')"
:key="imgIndex"
class="previewImg"
:src="imgItem.path"
alt=""
/>
</viewer>
<p
class="file-cell"
v-for="(fileItem, fileIndex) in (item.value || []).filter(cur => caseFileType(cur.extension) !== 'image')"
:key="fileIndex"
>
<img src="@/assets/images/通用文件.png" style="min-width: 15px; height: 15px; margin-right: 8px" />
<span class="file-name" @click="handlePreviewFile(fileItem)">{{ fileItem.name }}</span>
</p>
</FormItem>
</Col>
</template>
</Row>
</div>
</Form>
</Card>
</div>
<div class="drawer-footer">
<div class="action-btns">
<slot name="footer"></slot>
<!-- <Button @click="init.drawer.show =false">关闭</Button>-->
</div>
</div>
</Drawer>
</template>
<script setup>
import {
Card,
Divider,
Drawer,
FormItem,
InputNumber,
Message,
Modal,
Modal as ModalConfirm,
Page,
Row,
Tag
} from 'view-ui-plus'
import {reactive, ref} from "vue";
defineProps({
title: {
type: String,
default: '详情'
},
dataArray: {
type: Array,
default: () => []
}
})
defineEmits(['close'])
const show = ref(false)
const init = reactive({
grid: {
xs: 24,
sm: 12,
md: 12,
lg: 12,
},
drawer: {
show: true,
}
})
//附件类型判定
function caseFileType(type) {
let returnType = '';
switch (type) {
case '.png':
returnType = 'image'
break;
case '.jpeg':
returnType = 'image'
break;
case '.jpg':
returnType = 'image'
break;
default:
returnType = 'otherFile'
}
return returnType;
}
//附件下载
function handlePreviewFile(row) {
console.log(row)
window.location.href = window.location.origin + row.path
}
defineExpose({
show
})
</script>
<style scoped lang="less">
.drawer-content {
width: 100%;
height: calc(100% - 60px);
display: flex;
justify-content: center;
overflow: auto;
}
.approval-card {
height: fit-content;
width: 60%;
margin-bottom: 50px;
}
.approval-col {
display: flex;
}
.drawer-footer {
width: 100%;
height: 60px;
}
.action-btns {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 60px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
/deep/ .ivu-divider-horizontal {
display: block;
height: 1px;
width: 100%;
min-width: 100%;
margin: 13px 0;
clear: both;
}
.previewImg {
width: 80px;
height: 80px;
cursor: pointer;
margin-right: 15px;
}
.file-cell {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 0;
color: #1989f9;
cursor: pointer;
.file-delete-icon {
width: 20px;
height: 24px;
line-height: 24px;
background: #d6d6d6;
border-radius: 5px;
text-align: center;
color: #fff;
margin-left: 25px;
cursor: pointer;
}
.file-name {
flex: 1;
word-break: break-all;
}
}
</style>
\ No newline at end of file
...@@ -436,7 +436,7 @@ downloadLoading: false ...@@ -436,7 +436,7 @@ downloadLoading: false
}); });
// 用户表格列定义 // 申领记录表格列定义
const userColumns = computed(() => [ const userColumns = computed(() => [
{ {
title: '#', title: '#',
...@@ -445,60 +445,136 @@ const userColumns = computed(() => [ ...@@ -445,60 +445,136 @@ const userColumns = computed(() => [
fixed: 'left' fixed: 'left'
}, },
{ {
title: '设备编号', title: '申请单号',
key: 'device_id', key: 'application_id',
width: 120 width: 180,
ellipsis: true
}, },
{ {
title: '设备名称', title: '设备名称',
key: 'device_name', key: 'equipments',
width: 150 minWidth: 150,
render: (h, params) => {
// 展示所有设备名称,多个用逗号分隔
if (Array.isArray(params.row.equipments) && params.row.equipments.length) {
return h('span', params.row.equipments.map(e => e.name).join(','));
}
return h('span', '-');
}
},
{
title: '设备型号',
key: 'equipments',
minWidth: 120,
render: (h, params) => {
if (Array.isArray(params.row.equipments) && params.row.equipments.length) {
return h('span', params.row.equipments.map(e => e.model).join(','));
}
return h('span', '-');
}
},
{
title: '设备编号',
key: 'equipments',
minWidth: 120,
render: (h, params) => {
if (Array.isArray(params.row.equipments) && params.row.equipments.length) {
return h('span', params.row.equipments.map(e => e.unique_id).join(','));
}
return h('span', '-');
}
},
{
title: '生产厂家',
key: 'equipments',
minWidth: 150,
render: (h, params) => {
if (Array.isArray(params.row.equipments) && params.row.equipments.length) {
return h('span', params.row.equipments.map(e => e.manufacturer_name).join(','));
}
return h('span', '-');
}
}, },
{ {
title: '设备分类', title: '设备分类',
key: 'category', key: 'equipments',
width: 120, minWidth: 120,
render: (h, params) => { render: (h, params) => {
const categoryMap = { if (Array.isArray(params.row.equipments) && params.row.equipments.length) {
electronic: '电子设备', return h('span', params.row.equipments.map(e => e.classification_name).join(','));
mechanical: '机械设备',
office: '办公设备',
other: '其他'
} }
return h('span', categoryMap[params.row.category] || '-') return h('span', '-');
} }
}, },
{ {
title: '采购日期', title: '采购日期',
key: 'purchase_date', key: 'equipments',
width: 120 minWidth: 120,
render: (h, params) => {
if (Array.isArray(params.row.equipments) && params.row.equipments.length) {
return h('span', params.row.equipments.map(e => e.purchase_date).join(','));
}
return h('span', '-');
}
}, },
{ {
title: '入库时间', title: '入库时间',
key: 'storage_time', key: 'equipments',
width: 160 minWidth: 120,
render: (h, params) => {
if (Array.isArray(params.row.equipments) && params.row.equipments.length) {
return h('span', params.row.equipments.map(e => e.storage_date).join(','));
}
return h('span', '-');
}
}, },
{ {
title: '责任人', title: '存放位置',
key: 'manager', key: 'equipments',
width: 100 minWidth: 120,
render: (h, params) => {
if (Array.isArray(params.row.equipments) && params.row.equipments.length) {
return h('span', params.row.equipments.map(e => e.storage_location).join(','));
}
return h('span', '-');
}
}, },
{ {
title: '存放位置', title: '申请原因',
key: 'location', key: 'reason',
width: 120 minWidth: 120,
ellipsis: true
}, },
{ {
title: '维护周期', title: '计划使用时间',
key: 'maintenance_cycle', key: 'plan_start_date',
width: 120, minWidth: 120,
render: (h, params) => { render: (h, params) => {
const unitMap = { return h('span', params.row.plan_start_date || '-');
day: '天', }
month: '月', },
year: '年' {
} title: '预计归还时间',
return h('span', `${params.row.maintenance_cycle}${unitMap[params.row.cycle_unit] || ''}`) key: 'plan_end_date',
minWidth: 120,
render: (h, params) => {
return h('span', params.row.plan_end_date || '-');
}
},
{
title: '实际领用时间',
key: 'actual_start_date',
minWidth: 120,
render: (h, params) => {
return h('span', params.row.actual_start_date || '-');
}
},
{
title: '实际归还时间',
key: 'actual_end_date',
minWidth: 120,
render: (h, params) => {
return h('span', params.row.actual_end_date || '-');
} }
}, },
{ {
...@@ -520,6 +596,40 @@ const userColumns = computed(() => [ ...@@ -520,6 +596,40 @@ const userColumns = computed(() => [
}, status.text) }, status.text)
} }
}, },
{
title: '审核状态',
key: 'audit_status',
width: 100,
render: (h, params) => {
const auditStatusMap = {
0: { text: '待审核', color: 'default' },
1: { text: '审核中', color: 'primary' },
2: { text: '已通过', color: 'success' },
3: { text: '已拒绝', color: 'error' }
}
const status = auditStatusMap[params.row.audit_status] || auditStatusMap[0]
return h('Tag', {
props: {
color: status.color
}
}, status.text)
}
},
{
title: '申请人',
key: 'create_name',
minWidth: 100
},
{
title: '申请人工号',
key: 'create_card',
minWidth: 100
},
{
title: '申请时间',
key: 'createtime',
minWidth: 140
},
{ {
title: '操作', title: '操作',
slot: 'action', slot: 'action',
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或