add 申请管理和创建申请模块

duizhaopin_ui
jayboom 2 years ago
parent 37701fb9c2
commit 5a181fb1cb

@ -0,0 +1,17 @@
import request from '@/utils/request'
export function get_apply_list(data) {
return request({
url: '/api/temporary_auth/get_list',
method: 'post',
data
})
}
export function update_solve(data) {
return request({
url: '/api/temporary_auth/update_solve',
method: 'post',
data
})
}

@ -0,0 +1,25 @@
import request from '@/utils/request'
export function get_drug_group_list(data) {
return request({
url: '/api/temporary_auth/get_drug_group_list',
method: 'post',
data
})
}
export function get_pt_user_list(data) {
return request({
url: '/api/user/get_user_list',
method: 'post',
data
})
}
export function add_apply(data) {
return request({
url: '/api/temporary_auth/add',
method: 'post',
data
})
}

@ -127,6 +127,34 @@ const reagentRouter = [
} }
] ]
}, },
{
path: '/reagent/createapply',
component: Layout,
redirect: '/reagent/createapply/index',
meta: { classification: 'reagent', module_code: 'CreateApplyView' },
children: [
{
path: 'index',
name: 'createapply',
component: () => import('@/views/reagent/createapply/index'),
meta: { title: '创建申请', icon: '创建申请', classification: 'reagent' }
}
]
},
{
path: '/reagent/applymanagement',
component: Layout,
redirect: '/reagent/applymanagement/index',
meta: { classification: 'reagent', module_code: 'ApplyManagementView' },
children: [
{
path: 'index',
name: 'applymanagement',
component: () => import('@/views/reagent/applymanagement/index'),
meta: { title: '申请管理', icon: '申请管理', classification: 'reagent' }
}
]
},
{ {
path: '/reagent/weighing', path: '/reagent/weighing',
component: Layout, component: Layout,

@ -1,6 +1,7 @@
const getDefaultState = () => { const getDefaultState = () => {
return { return {
id : '',
token: '', token: '',
name: '', name: '',
avatar: '', avatar: '',
@ -32,6 +33,9 @@ const mutations = {
}, },
SET_USERMANAGE_AUTH: (state, userAuth) =>{ SET_USERMANAGE_AUTH: (state, userAuth) =>{
state.userAuth = userAuth state.userAuth = userAuth
},
SET_USER_ID: (state, id) => {
state.id = id
} }
} }

@ -169,6 +169,12 @@ export function filterAsyncRoutes(routers, roles) {
if (item.meta && item.meta.module_code === 'MainOverview') { if (item.meta && item.meta.module_code === 'MainOverview') {
return true return true
} }
if (item.meta && item.meta.module_code === 'CreateApplyView') {
return true
}
if (item.meta && item.meta.module_code === 'ApplyManagementView') {
return true
}
return !!roles.find(it => it.module_code === item.meta.module_code) return !!roles.find(it => it.module_code === item.meta.module_code)
}) })
} }

@ -256,6 +256,7 @@ export default {
this.$store.commit('user/SET_AVATAR', process.env.VUE_APP_FACE_API + '/' +user_info.avatar_url) this.$store.commit('user/SET_AVATAR', process.env.VUE_APP_FACE_API + '/' +user_info.avatar_url)
} }
// this.$store.commit('user/SET_AVATAR', user_info.avatar_url) // this.$store.commit('user/SET_AVATAR', user_info.avatar_url)
this.$store.commit('user/SET_USER_ID', user_info.user_id)
this.$store.commit('user/SET_NAME', user_info.real_name) this.$store.commit('user/SET_NAME', user_info.real_name)
this.$store.commit('user/SET_TOKEN', token) this.$store.commit('user/SET_TOKEN', token)
this.$store.dispatch('permission/generateRoutes') this.$store.dispatch('permission/generateRoutes')

@ -0,0 +1,339 @@
<template>
<div class="main-container-text">
<div class="title">申请管理</div>
<div class="header">
<el-select v-model="client_id" placeholder="请选择柜体">
<el-option
v-for="item in $store.getters.currentOptions"
:key="item.id"
:label="item.client_name"
:value="item.client_id"
/>
</el-select>
<el-button type="primary" plain @click="handleApply"><i class="el-icon-edit" />处理请求</el-button>
<!-- <div class="header-right">
<el-button type="primary" plain @click="handleHistory"></el-button>
<el-button icon="el-icon-refresh" circle @click="handleRefresh" />
</div> -->
<div class="header-right">
<el-button icon="el-icon-refresh" circle @click="handleRefresh" />
</div>
</div>
<el-table
stripe
:data="tableData"
:header-cell-style="headerStyle"
height="69vh"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column align="center" type="index" width="50" label="序号" />
<el-table-column prop="user_name" show-overflow-tooltip label="用户名称" align="center" />
<el-table-column prop="user_name_pt" show-overflow-tooltip label="陪同用户名称" align="center" />
<el-table-column prop="drug_name" show-overflow-tooltip label="试剂名称" align="center" />
<el-table-column prop="drug_num" show-overflow-tooltip label="试剂数量" align="center" />
<el-table-column prop="create_date" show-overflow-tooltip label="申请时间" align="center" />
<el-table-column prop="is_solve" show-overflow-tooltip label="状态" align="center">
<template slot-scope="scope">
<el-tag :type="statusColorMap[scope.row.is_solve]">{{ statusMap[scope.row.is_solve] }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="solve_user_name" show-overflow-tooltip label="受理人" align="center" />
<el-table-column prop="solve_user_pt_name" show-overflow-tooltip label="陪同受理人" align="center" />
<el-table-column prop="solve_date" show-overflow-tooltip label="受理时间" align="center" />
</el-table>
<div class="my-pagination" style="text-align: center">
<el-pagination
background
layout="prev, pager, next"
:current-page.sync="page"
:total="total"
:page-size.sync="page_size"
@current-change="pageChange"
/>
</div>
<el-dialog
:close-on-click-modal="false"
:visible.sync="dialogVisible"
width="30%"
height="500px"
title="录入库存"
@close="onClose"
>
<div class="box">
<el-scrollbar style="height: 100%">
<el-form>
<div v-for="(item, index) in multipleSelection" :key="index">
<el-col :span="24">
<el-form-item :label="item.name" prop="input_num">
<el-input
v-model="item.input_num"
placeholder="请输入数量"
clearable
type="number"
:style="{width: '100%'}"
/>
</el-form-item>
</el-col>
</div>
</el-form>
</el-scrollbar>
</div>
<div slot="footer" style="text-align: center">
<el-button @click="close"></el-button>
<el-button type="primary" @click="handelConfirm"></el-button>
</div>
</el-dialog>
<el-dialog :close-on-click-modal="false" :visible.sync="dialogHistoryVisible" width="60%" title="申请详情">
<div class="box">
<el-scrollbar style="height: 100%">
<el-table
v-loading="loadingHistory"
element-loading-text="拼命加载中"
:header-cell-style="headerStyle"
:data="historyData"
height="420"
@close="dialogHistoryClose"
>
<el-table-column align="center" type="index" width="50" label="序号" />
<el-table-column align="center" property="name" label="试剂名称" />
<el-table-column align="center" property="purity" label="纯度" />
<el-table-column align="center" property="speci" label="规格" />
<el-table-column align="center" property="purity" label="纯度" />
<el-table-column align="center" property="input_num" label="录入量" />
<el-table-column align="center" property="stock_num" label="库存量" />
<el-table-column align="center" property="difference_num" label="相差值" />
</el-table>
</el-scrollbar>
</div>
</el-dialog>
</div>
</template>
<script>
import {
get_list,
get_drug_list,
set_stock,
del_stock,
get_stock_info
} from '@/api/reagent/drugStock'
import {
get_apply_list
} from '@/api/reagent/applymanage'
import stringify from '@/utils/stringify'
export default {
name: 'ApplyManagementView',
data() {
return {
// drugStockForm:[],
page: 1,
page_size: 15,
total: 0,
client_id: '',
dialogVisible: false,
tableData: [],
headerStyle: { 'background': '#E6E6E6' },
multipleSelection: [],
handleSelectionSelection: [],
dialogHistoryVisible: false,
loadingHistory: false,
historyData: [],
name: '',
history_client_id: '',
value1: '',
value2: ['', ''],
history_page: 1,
history_page_size: 15,
history_total: 100,
statusColorMap: ['warning','success'],
statusMap: ['未处理', '已处理'],
}
},
created () {
this.client_id = this.$store.getters.currentOptions[0].client_id
this.get_apply()
},
methods: {
get_apply: function() {
const data = {
client_id: this.client_id,
page:this.page,
page_size: this.page_size
}
get_apply_list(stringify(data)).then(rsp => {
console.log("apply>>>", rsp)
this.tableData = rsp.data.data_list
this.total = rsp.data.total_count
})
},
pageChange(page) {
this.page = page
this.get_stock_list()
},
handleSelectionChange(val) {
this.handleSelectionSelection = val
},
// handleHistory() {
// this.dialogHistoryVisible = true
// },
handleRefresh() {
this.get_apply()
},
handleDel() {
if (this.handleSelectionSelection.length === 1) {
const data = {
id:this.handleSelectionSelection[0].id
}
del_stock(stringify(data)).then(rsp => {
if (rsp.status === 0) {
this.$message.success("删除成功!")
this.get_stock_list()
} else {
this.$message.error(rsp.msg)
}
})
} else {
this.$message.warning("选择一条记录操作")
}
},
//
handleAddReagent() {
const data = {
client_id: this.client_id
}
get_drug_list(stringify(data)).then(rsp => {
this.multipleSelection = rsp.data
})
this.dialogVisible = true
},
handleApply() {
const data = {
client_id: this.client_id
}
get_drug_list(stringify(data)).then(rsp => {
this.multipleSelection = rsp.data
})
this.dialogVisible = true
},
//
handleCheck() {
if (this.handleSelectionSelection.length === 1) {
this.dialogHistoryVisible = true
const data = {
id:this.handleSelectionSelection[0].id
}
get_stock_info(stringify(data)).then(rsp => {
if (rsp.status === 0) {
this.historyData = rsp.data
} else {
this.$message.error(rsp.msg)
}
})
} else {
this.$message.warning("选择一条记录操作!")
}
},
dialogHistoryClose() {
this.dialogHistoryVisible = false
this.historyData = []
},
onClose() {
this.multipleSelection = []
},
close() {
this.dialogVisible = false
this.multipleSelection = []
},
handelConfirm() {
const stock_info = {}
for (let i = 0; i < this.multipleSelection.length; i++) {
stock_info[this.multipleSelection[i].name] = this.multipleSelection[i].input_num == "" ? 0: parseInt(this.multipleSelection[i].input_num)
}
const data = {
stock_info: JSON.stringify(stock_info),
client_id: this.client_id,
client_code: this.client_code
}
set_stock(stringify(data)).then(rsp => {
console.log(rsp)
if (rsp.status == 0) {
this.$message.success(rsp.msg)
this.dialogVisible = false
this.get_stock_list()
} else {
this.$message.error(rsp.msg)
}
})
},
searchHistory() {
}
}
}
</script>
<style lang="scss" scoped>
.main-container-text {
min-height: calc(100vh - 110px);
padding: 1rem;
margin: 1rem;
background: white;
.title {
font-size: 20px;
font-weight: bold;
color: #000000;
}
.header {
margin: 1rem 0 1rem 0;
.el-input {
width: 9.375rem;
margin-right: 1rem;
}
.el-select {
margin-right: 1rem;
}
.header-right {
float: right;
}
}
}
.add-item {
margin-bottom: 1rem;
}
</style>
<style>
/* 1,必须去掉scoped否则overflow-x: hidden失效 */
.box {
margin: 0 auto;
width: 95%;
height: 95%;
}
/* 2外包一个div,来减少对其他页面会有冲突此时缺少scoped */
.box .el-scrollbar__wrap {
overflow-x: hidden;
}
.el-dialog__body {
height: 500px;
}
</style>

@ -0,0 +1,271 @@
<template>
<div class="main-container-text">
<div class="title">创建申请</div>
<div class="header">
<el-select v-model="client_id" placeholder="请选择柜体">
<el-option
v-for="item in $store.getters.currentOptions"
:key="item.id"
:label="item.client_name"
:value="item.client_id"
/>
</el-select>
<el-button type="primary" plain @click="openDialogTableVisible"><i class="el-icon-edit" />申请</el-button>
<el-dialog title="确认提交申请" :visible.sync="dialogTableVisible">
<el-form :inline="true" :model="pt_form" :rules="rules" ref="pt_form" class="demo-form-inline">
<el-form-item label="申请陪同人" prop="user_id_pt">
<el-select v-model="pt_form.user_id_pt" filterable placeholder="请选择陪同人">
<el-option
v-for="item in ptUserArray"
:key="item.user_id"
:label="item.real_name"
:value="item.user_id">
</el-option>
</el-select>
</el-form-item>
</el-form>
<el-table :data="checkList">
<el-table-column align="center" type="index" width="50" label="序号" />
<el-table-column prop="name" show-overflow-tooltip label="试剂名称" align="center" />
<el-table-column prop="drug_num" show-overflow-tooltip label="试剂数量" align="center" />
<el-table-column prop="speci" show-overflow-tooltip label="规格" align="center" />
<el-table-column prop="purity" show-overflow-tooltip label="纯度" align="center" />
<el-table-column prop="distributor" show-overflow-tooltip label="经销商" align="center" />
<el-table-column prop="manufacturer" show-overflow-tooltip label="生产厂家" align="center" />
</el-table>
<div slot="footer" style="text-align: center">
<el-button @click="dialogTableClose"></el-button>
<el-button type="primary" @click="create_apply(pt_form)"></el-button>
</div>
</el-dialog>
<div class="header-right">
<el-button icon="el-icon-refresh" circle @click="handleRefresh" />
</div>
</div>
<el-table
stripe
:data="tableData"
:header-cell-style="headerStyle"
height="69vh"
@row-click="singleElection"
>
<el-table-column type="selection" width="55" align="center" label="选择">
<template slot-scope="scope">
<el-radio class="radio" v-model="templateSelection" :label="scope.row.index"
>{{''}}</el-radio
>
</template>
</el-table-column>
<el-table-column align="center" type="index" width="50" label="序号" />
<el-table-column prop="name" show-overflow-tooltip label="试剂名称" align="center" />
<el-table-column prop="drug_num" show-overflow-tooltip label="试剂数量" align="center" />
<el-table-column prop="speci" show-overflow-tooltip label="规格" align="center" />
<el-table-column prop="purity" show-overflow-tooltip label="纯度" align="center" />
<el-table-column prop="distributor" show-overflow-tooltip label="经销商" align="center" />
<el-table-column prop="manufacturer" show-overflow-tooltip label="生产厂家" align="center" />
</el-table>
<div class="my-pagination" style="text-align: center">
<el-pagination
background
layout="prev, pager, next"
:current-page.sync="page"
:total="total"
:page-size.sync="page_size"
@current-change="pageChange"
/>
</div>
</div>
</template>
<script>
import stringify from '@/utils/stringify'
import {
add_apply,
get_pt_user_list,
get_drug_group_list
} from '@/api/reagent/createapply'
export default {
name: 'CreateApply',
data() {
return {
// drugStockForm:[],
page: 1,
page_size: 15,
total: 0,
client_id: '',
dialogVisible: false,
tableData: [],
headerStyle: { 'background': '#E6E6E6' },
multipleSelection: [],
handleSelectionSelection: [],
dialogHistoryVisible: false,
loadingHistory: false,
historyData: [],
name: '',
history_client_id: '',
value1: '',
value2: ['', ''],
history_page: 1,
history_page_size: 15,
history_total: 100,
dialogTableVisible: false,
templateSelection: "",
checkList: [],
ptUserArray:[],
pt_form:{
user_id_pt: '',
},
rules: {
user_id_pt: [
{ required: true, message: '请选择陪同人', trigger: 'change' }
],
}
}
},
created () {
this.client_id = this.$store.getters.currentOptions[0].client_id
this.get_drug_group()
this.get_pt_user()
},
methods: {
get_drug_group: function() {
const data = {
client_id: this.client_id,
page:this.page,
page_size: this.page_size
}
get_drug_group_list(stringify(data)).then(rsp => {
console.log("rsp.data.data_list>>", rsp.data.data_list)
this.tableData = this.addDataIndex(rsp.data.data_list)
this.total = rsp.data.total_count
})
},
get_pt_user() {
console.log("jjj")
const data = {
page: this.page,
page_size: this.page_size,
user_code: this.user_code,
real_name: this.real_name,
role_id: this.role_id,
is_enabled: this.is_enabled
}
console.log("hhhhh")
get_pt_user_list(stringify(data)).then(res => {
this.ptUserArray = res.data.data_list
console.log("res>>>", res)
})
console.log("giao")
},
create_apply(pt_from){
console.log("pt_from.user_id_pt>>>", pt_from.user_id_pt)
if (pt_from.user_id_pt === '') {
console.log("请选择陪同人")
}
},
pageChange(page) {
this.page = page
this.get_stock_list()
},
singleElection(row){
this.templateSelection = row.index
this.checkList = this.tableData.filter((item) => item.index === row.index)
},
addDataIndex(initData){
for (let i = 0; i < initData.length; i++) {
initData[i]["index"] = i
}
return initData
},
handleRefresh() {
this.get_drug_group()
},
handleApply() {
const data = {
client_id: this.client_id
}
get_drug_list(stringify(data)).then(rsp => {
this.multipleSelection = rsp.data
})
this.dialogVisible = true
},
onClose() {
this.multipleSelection = []
},
close() {
this.dialogVisible = false
this.multipleSelection = []
},
openDialogTableVisible(){
if (this.checkList.length === 0 ){
alert("未选择");
} else {
this.dialogTableVisible = true
}
},
dialogTableClose() {
this.user_id_pt = ''
this.dialogTableVisible = false
},
}
}
</script>
<style lang="scss" scoped>
.main-container-text {
min-height: calc(100vh - 110px);
padding: 1rem;
margin: 1rem;
background: white;
.title {
font-size: 20px;
font-weight: bold;
color: #000000;
}
.header {
margin: 1rem 0 1rem 0;
.el-input {
width: 9.375rem;
margin-right: 1rem;
}
.el-select {
margin-right: 1rem;
}
.header-right {
float: right;
}
}
}
.add-item {
margin-bottom: 1rem;
}
</style>
<style>
/* 1,必须去掉scoped否则overflow-x: hidden失效 */
.box {
margin: 0 auto;
width: 95%;
height: 95%;
}
/* 2外包一个div,来减少对其他页面会有冲突此时缺少scoped */
.box .el-scrollbar__wrap {
overflow-x: hidden;
}
.el-dialog__body {
height: 500px;
}
</style>
Loading…
Cancel
Save