feat(src/views/reagent/report/record/index.vue): 完成 入库记录、领用记录、归还记录

duizhaopin_ui
duan 2 years ago
parent 327a4eaa9f
commit 5df99f8aaf

@ -44,3 +44,21 @@ export function drug_user_use_expend(data) {
data data
}) })
} }
// /api/report/use_frequency
export function use_frequency(data) {
return request({
url: '/api/report/use_frequency',
method: 'post',
data
})
}
// /api/report/drug_log_type_info
export function drug_log_type_info(data) {
return request({
url: '/api/report/drug_log_type_info',
method: 'post',
data
})
}

@ -121,6 +121,20 @@ export const constantRoutes = [
component: () => import('@/views/reagent/report/userconsum/index'), component: () => import('@/views/reagent/report/userconsum/index'),
hidden: true, hidden: true,
meta: { title: '人员用量消耗', icon: '报表统计' } meta: { title: '人员用量消耗', icon: '报表统计' }
},
{
path: 'usefrequencyinfo',
name: 'UseFrequencyInfo',
component: () => import('@/views/reagent/report/usefrequency/index'),
hidden: true,
meta: { title: '使用频率', icon: '报表统计' }
},
{
path: 'recordinfo/:t',
name: 'RecordInfo',
component: () => import('@/views/reagent/report/record/index'),
hidden: true,
meta: { title: '记录', icon: '报表统计' }
} }
] ]
}, },

@ -12,7 +12,7 @@
<div class="use-info"> <div class="use-info">
<div class="title text">试剂使用统计</div> <div class="title text">试剂使用统计</div>
<div class="use-info-content"> <div class="use-info-content">
<div class="user-info-text"> <div class="user-info-text" @click="$router.push('/reagent/report/usefrequencyinfo')">
<div class="user-info-img" style="float: right"><img src="@/assets/4-报表统计/使用频率.png"></div> <div class="user-info-img" style="float: right"><img src="@/assets/4-报表统计/使用频率.png"></div>
<div class="title text" style="color:#FF9B02 ">使用频率</div> <div class="title text" style="color:#FF9B02 ">使用频率</div>
<div class="use-count">5,037</div> <div class="use-count">5,037</div>
@ -20,7 +20,7 @@
<div>已领用183次归还180次</div> <div>已领用183次归还180次</div>
<div>乙醇</div> <div>乙醇</div>
</div> </div>
<div class="user-info-text"> <div class="user-info-text" @click="$router.push('/reagent/report/recordinfo/store')">
<div class="user-info-img" style="float: right"><img src="@/assets/4-报表统计/入库记录.png"></div> <div class="user-info-img" style="float: right"><img src="@/assets/4-报表统计/入库记录.png"></div>
<div class="title text" style="color:#409EFF ">入库记录</div> <div class="title text" style="color:#409EFF ">入库记录</div>
<div class="use-count">5,037</div> <div class="use-count">5,037</div>
@ -28,7 +28,7 @@
<div>已领用183次归还180次</div> <div>已领用183次归还180次</div>
<div>乙醇</div> <div>乙醇</div>
</div> </div>
<div class="user-info-text"> <div class="user-info-text" @click="$router.push('/reagent/report/recordinfo/collect')">
<div class="user-info-img" style="float: right"><img src="@/assets/4-报表统计/领用记录.png"></div> <div class="user-info-img" style="float: right"><img src="@/assets/4-报表统计/领用记录.png"></div>
<div class="title text" style="color: #1ADCE9">领用记录</div> <div class="title text" style="color: #1ADCE9">领用记录</div>
<div class="use-count">5,037</div> <div class="use-count">5,037</div>
@ -36,7 +36,7 @@
<div>已领用183次归还180次</div> <div>已领用183次归还180次</div>
<div>乙醇</div> <div>乙醇</div>
</div> </div>
<div class="user-info-text"> <div class="user-info-text" @click="$router.push('/reagent/report/recordinfo/sendback')">
<div class="user-info-img" style="float: right"><img src="@/assets/4-报表统计/归还记录.png"></div> <div class="user-info-img" style="float: right"><img src="@/assets/4-报表统计/归还记录.png"></div>
<div class="title text" style="color: #5DDC1D">归还记录</div> <div class="title text" style="color: #5DDC1D">归还记录</div>
<div class="use-count">5,037</div> <div class="use-count">5,037</div>

@ -122,7 +122,7 @@ export default {
margin-bottom: 1rem; margin-bottom: 1rem;
.header-left{ .header-left{
.el-input{ .el-input{
width:160px; width:170px;
margin-right: 1rem; margin-right: 1rem;
margin-left: 1rem; margin-left: 1rem;
} }

@ -125,7 +125,7 @@ export default {
margin-bottom: 1rem; margin-bottom: 1rem;
.header-left{ .header-left{
.el-input{ .el-input{
width:160px; width:170px;
margin-right: 1rem; margin-right: 1rem;
margin-left: 1rem; margin-left: 1rem;
} }

@ -117,7 +117,7 @@ export default {
margin-left: 1rem; margin-left: 1rem;
} }
.el-input{ .el-input{
width:160px; width:170px;
margin-right: 1rem; margin-right: 1rem;
margin-left: 1rem; margin-left: 1rem;
} }

@ -0,0 +1,178 @@
<template>
<div class="main-content-container">
<div class="title">{{ titleMap[$route.params.t] }}</div>
<div class="header">
<div class="header-left">
<el-button size="small" @click="$router.push('/reagent/report/index')"></el-button>
<el-select v-model="client_id" size="small" placeholder="请选择柜体" />
<el-select v-model="select_status" size="small" placeholder="请选择状态">
<el-option
v-for="(item,index) in statusMap"
:key="index"
:label="item"
:value="index"
/>
</el-select>
<el-input v-model="user_name" size="small" placeholder="请输入操作人员" />
<el-input v-model="selectReagentValue" size="small" placeholder="请输入搜索试剂名称" />
<div class="search">
<el-date-picker
v-model="start_time"
type="datetime"
placeholder="选择生产日期"
value-format="yyyy-MM-dd HH:mm:ss"
/>
<el-date-picker
v-model="end_time"
type="datetime"
placeholder="选择过期日期"
value-format="yyyy-MM-dd HH:mm:ss"
/>
<el-button size="small" type="primary" icon="el-icon-search" @click="searchReagent"></el-button>
</div>
</div>
<div class="header-right">
<el-button>导出报告</el-button>
<el-button icon="el-icon-refresh" circle @click="getStoreInfo" />
</div>
</div>
<el-table
v-loading="loadingReagent"
element-loading-text="拼命加载中"
:header-cell-style="headerStyle"
:data="reagentData"
height="420"
>
<el-table-column align="center" property="name" label="试剂名称" />
<el-table-column align="center" property="english_name" label="英文名称" />
<el-table-column align="center" property="bar_code" label="试剂编码" />
<el-table-column align="center" property="purity" label="纯度" />
<el-table-column align="center" property="cas_number" label="CAS码" />
<el-table-column align="center" property="use_quantity" label="用量" />
<el-table-column align="center" property="status" label="状态">
<template slot-scope="scope">
<el-tag :type="statusColorMap[scope.row.status-1]">{{ statusMap[scope.row.status-1] }}</el-tag>
</template>
</el-table-column>
<el-table-column align="center" property="create_date" label="归还时间" />
<el-table-column align="center" property="create_user_name" label="操作人员" />
<el-table-column align="center" property="client_id" label="所属终端" />
</el-table>
<div style="text-align: center">
<el-pagination
layout="prev, pager, next"
:current-page.sync="page"
:total="total"
:page-size.sync="page_size"
@current-change="pageChange"
/>
</div>
</div>
</template>
<script>
import { drug_log_type_info } from '@/api/report'
import stringify from '@/utils/stringify'
export default {
name: 'Record',
data() {
return {
titleMap: {
'store': '入库记录',
'collect': '领用记录',
'sendback': '归还记录'
},
record_type: {
'store': '1',
'collect': '2',
'sendback': '3'
},
statusMap: ['在库', '出库', '空瓶'],
statusColorMap: ['success', '', 'warning'],
selectReagentValue: '',
user_name: '',
client_id: null,
select_status: null,
headerStyle: { 'background': '#E6E6E6' },
page: 1,
page_size: 15,
total: 0,
reagentData: [],
loadingReagent: false,
start_time: null,
end_time: null
}
},
created() {
this.getStoreInfo()
},
methods: {
//
searchReagent() {
this.pageChange(1)
},
//
pageChange(page) {
this.page = page
this.getStoreInfo()
},
//
getStoreInfo() {
this.loadingReagent = true
drug_log_type_info(stringify({
record_type: this.record_type[this.$route.params.t],
name: this.selectReagentValue,
user_name: this.user_name,
status: this.select_status,
client_id: this.client_id,
start_time: this.start_time,
end_time: this.end_time,
page: this.page,
page_size: this.page_size
})).then(res => {
this.reagentData = res.data.data
this.total = res.data.total_count
}).finally(() => { this.loadingReagent = false })
}
}
}
</script>
<style lang="scss" scoped>
.main-content-container{
margin: 1rem;
background: white;
min-height: calc(100vh - 12rem);
padding: 1rem;
.title {
font-size: 1.25rem;
font-weight: bold;
color: #000000;
margin-bottom: 1rem;
}
.header{
display: flex;
justify-content: space-between;
margin-bottom: 1rem;
.header-left{
.el-select{
margin-left: 1rem;
}
.el-input{
width:170px;
margin-right: 1rem;
margin-left: 1rem;
}
.search{
margin-top:1rem ;
.el-date-editor{
margin-left: 0rem;
}
}
}
}
}
</style>

@ -103,7 +103,7 @@ export default {
margin-bottom: 1rem; margin-bottom: 1rem;
.header-left{ .header-left{
.el-input{ .el-input{
width:160px; width:170px;
margin-right: 1rem; margin-right: 1rem;
margin-left: 1rem; margin-left: 1rem;
} }

@ -127,7 +127,7 @@ export default {
margin-bottom: 1rem; margin-bottom: 1rem;
.header-left{ .header-left{
.el-input{ .el-input{
width:160px; width:170px;
margin-right: 1rem; margin-right: 1rem;
margin-left: 1rem; margin-left: 1rem;
} }

@ -125,7 +125,7 @@ export default {
margin-bottom: 1rem; margin-bottom: 1rem;
.header-left{ .header-left{
.el-input{ .el-input{
width:160px; width:170px;
margin-right: 1rem; margin-right: 1rem;
margin-left: 1rem; margin-left: 1rem;
} }

Loading…
Cancel
Save