duizhaopin_ui
13507605001 2 years ago
parent 8efef0ff67
commit c7cef5d179

@ -5,8 +5,36 @@
</template> </template>
<script> <script>
import ast from '@/utils/astrict.js'
import { faceStop } from '@/api/user/user'
export default { export default {
name: 'App' name: 'App',
data() {
return {
intval: null
}
},
created() {
this.intval = ast()
// window.addEventListener('beforeunload', (event) => {
// faceStop().then(res => { console.log(res) })
// })
window.onbeforeunload = (e) => {
e = e || window.event
if (e) {
e.returnValue = '关闭提示'
}
faceStop().then(res => { console.log(res) })
// Chrome, Safari, Firefox 4+, Opera 12+ , IE 9+
return '关闭提示'
}
},
destroyed() {
if (this.intval) {
clearInterval(this.intval)
}
}
} }
</script> </script>

@ -0,0 +1,154 @@
import axios from 'axios'
import store from '@/store'
import { get_func_type } from '@/utils/index'
// 默认token
axios.defaults.headers.common['Authorization'] = 'Bearer ' + store.getters.token
// 封装接口调用后模拟点击
export function click_dowload(data, res) {
const blobUrl = window.URL.createObjectURL(res.data)
const a = document.createElement('a')
a.style.display = 'none'
a.download = `${data.file_name}.xlsx`
a.href = blobUrl
a.click()
}
const request_server = axios.create(
{
baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
// withCredentials: true, // send cookies when cross-domain requests
timeout: 8000, // request timeout
method: 'get',
responseType: 'blob'
}
)
// request interceptor
request_server.interceptors.request.use(
config => {
if (store.getters.token) {
// let each request carry token
// ['X-Token'] is a custom headers key
// please modify it according to the actual situation
config.headers['Authorization'] = 'Bearer ' + store.getters.token
}
// 添加func_type参数
if (config.params) {
if (Object.prototype.toString.call(config.data) === '[object FormData]') {
if (config.params.get('func_type') === null) {
config.params.append('func_type', get_func_type())
}
} else {
config.params['func_type'] = get_func_type()
}
} else {
const formData = new FormData()
formData.append('func_type', get_func_type())
config.params = formData
}
return config
},
error => {
// do something with request error
console.log(error) // for debug
return Promise.reject(error)
}
)
// 库存信息总览导出
export function dowload_stock_data_info(data) {
return request_server(
{
url: '/api/report/stock_data_info',
params: data
}
)
}
// 试剂信息详情or入库信息查询 导出
export function dowload_drug_details_info(data) {
return request_server(
{
url: '/api/report/drug_details_info',
params: data
}
)
}
// 库存消耗 导出
export function dowload_stock_loss_info(data) {
return request_server(
{
url: '/api/report/stock_loss_info',
params: data
}
)
}
// 试剂用量消耗 导出
export function dowload_drug_use_expend(data) {
return request_server(
{
url: '/api/report/drug_use_expend',
params: data
}
)
}
// 人员用量消耗 导出
export function dowload_drug_user_use_expend(data) {
return request_server(
{
url: '/api/report/drug_user_use_expend',
params: data
}
)
}
// 使用频率 导出
export function dowload_use_frequency(data) {
return request_server(
{
url: '/api/report/use_frequency',
params: data
}
)
}
// 入库、领用、归还 导出
export function dowload_drug_log_type_info(data) {
return request_server(
{
url: '/api/report/drug_log_type_info',
params: data
}
)
}
// 环境监测_天 导出
export function dowload_day_monitor(data) {
return request_server(
{
url: '/api/monitor/day_monitor',
params: data
}
)
}
// 环境监测_时 导出
export function dowload_day_monitor_info(data) {
return request_server(
{
url: '/api/monitor/day_monitor_info',
params: data
}
)
}
// /api/report/report_home
export function dowload_putin_acceptance_record(data) {
return request_server({
url: '/api/report/putin_acceptance_record',
data
})
}

@ -61,3 +61,11 @@ export function put_in_tmp(data) {
}) })
} }
// /api/drug_tmplate/pring_bar_code
export function pring_bar_code(data) {
return request({
url: '/api/drug_tmplate/pring_bar_code',
method: 'post',
data
})
}

@ -1,7 +1,6 @@
import request from '@/utils/request' import request from '@/utils/request'
export function login(data) { export function login(data) {
console.log(1111111111111111111111111111111111, data)
return request({ return request({
url: '/api/user/login', url: '/api/user/login',
method: 'post', method: 'post',

@ -0,0 +1,311 @@
/**
* Created by PanJiaChen on 16/11/18.
*/
import reagentRouter from '@/router/modules/reagent'
import userRouter from '@/router/modules/user'
import standardRouter from '@/router/modules/standard'
// import dangerousRouter from '@/router/modules/dangerous'
import consumablesRouter from '@/router/modules/consumables'
import instrumentRouter from '@/router/modules/instrument'
import store from '@/store'
/**
* Parse the time to string
* @param {(Object|string|number)} time
* @param {string} cFormat
* @returns {string | null}
*/
export function parseTime(time, cFormat) {
if (arguments.length === 0 || !time) {
return null
}
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if ((typeof time === 'string')) {
if ((/^[0-9]+$/.test(time))) {
// support "1548221490638"
time = parseInt(time)
} else {
// support safari
// https://stackoverflow.com/questions/4310953/invalid-date-in-safari
time = time.replace(new RegExp(/-/gm), '/')
}
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
}
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
const value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') {
return ['日', '一', '二', '三', '四', '五', '六'][value]
}
return value.toString().padStart(2, '0')
})
return time_str
}
/**
* @param {number} time
* @param {string} option
* @returns {string}
*/
export function formatTime(time, option) {
if (('' + time).length === 10) {
time = parseInt(time) * 1000
} else {
time = +time
}
const d = new Date(time)
const now = Date.now()
const diff = (now - d) / 1000
if (diff < 30) {
return '刚刚'
} else if (diff < 3600) {
// less 1 hour
return Math.ceil(diff / 60) + '分钟前'
} else if (diff < 3600 * 24) {
return Math.ceil(diff / 3600) + '小时前'
} else if (diff < 3600 * 24 * 2) {
return '1天前'
}
if (option) {
return parseTime(time, option)
} else {
return (
d.getMonth() +
1 +
'月' +
d.getDate() +
'日' +
d.getHours() +
'时' +
d.getMinutes() +
'分'
)
}
}
/**
* @param {string} url
* @returns {Object}
*/
export function param2Obj(url) {
const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ')
if (!search) {
return {}
}
const obj = {}
const searchArr = search.split('&')
searchArr.forEach(v => {
const index = v.indexOf('=')
if (index !== -1) {
const name = v.substring(0, index)
const val = v.substring(index + 1, v.length)
obj[name] = val
}
})
return obj
}
// 防抖
export function debounce(fn, time) {
time = time || 200
// 定时器
let timer = null
return function(...args) {
var _this = this
if (timer) {
clearTimeout(timer)
}
timer = setTimeout(function() {
timer = null
fn.apply(_this, args)
}, time)
}
}
// 节流
export function throttle(fn, time) {
let timer = null
time = time || 1000
return function(...args) {
if (timer) {
return
}
const _this = this
timer = setTimeout(() => {
timer = null
}, time)
fn.apply(_this, args)
}
}
export function filterAsyncRoutes(routers, roles) {
return routers.filter(item => {
if (item.meta && item.meta.title === '返回主页') {
return true
}
if (item.meta && item.meta.module_code === 'MainOverview') {
return true
}
return !!roles.find(it => it.module_code === item.meta.module_code)
})
}
export function getALLRouter(data) {
// TODO: 其他路由都在此操作
const rasr = filterAsyncRoutes(reagentRouter, data.drug_manage)
const standard = filterAsyncRoutes(standardRouter, data.drug_manage)
const consumables = filterAsyncRoutes(consumablesRouter, data.drug_manage)
const instrument = filterAsyncRoutes(instrumentRouter, data.drug_manage)
// const uasr = filterAsyncRoutes(userRouter, data.drug_manage)
// const standard = filterAsyncRoutes(standardRouter, data.drug_manage)
const asyncRoutes = [
...userRouter,
...rasr,
...standard,
...consumables,
...instrument,
// 404 page must be placed at the end !!!
{ path: '*', redirect: '/404', hidden: true }
]
const option = [
{
name: 'reagent',
router: rasr[0],
title: '试剂管理'
},
{
name: 'standard',
router: standard[0],
title: '标准品管理'
},
{
name: 'consumables',
router: consumables[0],
title: '耗材管理'
},
{
name: 'instrument',
router: instrument[0],
title: '仪器管理'
},
// {
// name: 'dangerous',
// router: dangerousRouter[0],
// title: '危化品管理'
// },
{
name: 'user',
router: userRouter[0],
title: '用户管理'
}
]
return { asyncRoutes, option }
}
export let userMedia = function(constraints, success, error) {
if (navigator.mediaDevices.getUserMedia) {
userMedia = function(constraints, success, error) {
navigator.mediaDevices.getUserMedia(constraints).then(success).catch(error)
}
} else if (navigator.webkitGetUserMedia) {
userMedia = function(constraints, success, error) {
navigator.webkitGetUserMedia(constraints, success, error)
}
} else if (navigator.mozGetUserMedia) {
userMedia = function(constraints, success, error) {
navigator.mozGetUserMedia(constraints, success, error)
}
} else if (navigator.getUserMedia) {
userMedia = function(constraints, success, error) {
navigator.getUserMedia(constraints, success, error)
}
}
userMedia(constraints, success, error)
}
export const web_stream = {
get: function(url, callback) {
let webClient
if (url.startsWith('http://')) {
webClient = require('http')
} else if (url.startsWith('https://')) {
webClient = require('https')
} else {
// eslint-disable-next-line no-throw-literal
throw 'Unsupported protocol.'
}
const clientRequest = webClient.get(url, function(response) {
response.on('data', function(chunk) {
// let data = chunk.toString().split(/\r\n/);
callback(chunk)
})
})
return {
url: url,
handler: clientRequest,
on: function(type, listener) {
clientRequest.on(type, listener)
},
destroy: function() {
clientRequest.destroy()
}
}
}
}
export const get_path = function(path) {
const pa = path.split('/')[1]
const pathMap = {
'reagent': 'reagent',
'user': 'user',
'standard': 'standard',
'consumables': 'consumables',
'instrument': 'instrument',
'userinfo': store.getters.classification
}
return pathMap[pa]
}
/*
定义一个func_map,供后续使用
*/
export const func_map = {
'reagent': '1',
'standard': '2',
'consumables': '3',
'instrument': '4'
}
/*
不同路径得到不同的参数
*/
export const get_func_type = function() {
return func_map[store.getters.classification]
}

@ -2,9 +2,9 @@
<div :class="{'has-logo':showLogo}"> <div :class="{'has-logo':showLogo}">
<!-- <logo v-if="showLogo" :collapse="isCollapse" />--> <!-- <logo v-if="showLogo" :collapse="isCollapse" />-->
<div class="user" @click="handleUserClick"> <div class="user" @click="handleUserClick">
<div class="user-pic"><el-avatar :size="50" :src="circleUrl" /></div> <div class="user-pic"><el-avatar :size="50" :src="$store.state.user.avatar || circleUrl" /></div>
<div class="user-name">程小红</div> <div class="user-name">{{ $store.state.user.name }}</div>
<div class="user-role">管理员</div> <div class="user-role">{{ $store.state.user.role_name }}</div>
</div> </div>
<el-scrollbar wrap-class="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
<el-menu <el-menu
@ -33,7 +33,7 @@ export default {
components: { SidebarItem }, components: { SidebarItem },
data() { data() {
return { return {
circleUrl: 'https://t7.baidu.com/it/u=2006997523,200382512&fm=193&f=GIF' circleUrl: require('@/assets/rms/header.jpeg')
} }
}, },
computed: { computed: {

@ -0,0 +1,254 @@
import Layout from '@/layout'
// 耗材管理路由 com
const consumablesRouter = [
{
path: '/consumables/mainoverview',
component: Layout,
redirect: '/consumables/mainoverview/index',
meta: { classification: 'consumables', module_code: 'MainOverview' },
children: [
{
path: 'index',
name: 'standardMainOverview',
meta: { title: '主预览', icon: '主概览', classification: 'consumables' },
component: () => import('@/views/reagent/mainoverview/index')
}
]
},
{
path: '/consumables/report',
component: Layout,
redirect: '/consumables/report/index',
meta: { classification: 'consumables', module_code: 'DataReportIndex' },
children: [
{
path: 'index',
name: 'standardReport',
component: () => import('@/views/reagent/report/index'),
meta: { title: '报告统计', icon: '报表统计', classification: 'consumables' }
},
{
path: 'storeinfo',
name: 'standardStoreInfo',
component: () => import('@/views/reagent/report/storeinfo/index'),
hidden: true,
meta: { title: '库存信息总览', icon: '报表统计', classification: 'consumables', activeMenu: '/consumables/report/index' }
},
{
path: 'standardinfo',
name: 'standardInfo',
component: () => import('@/views/reagent/report/reagentinfo/index'),
hidden: true,
meta: { title: '耗材信息详情', icon: '报表统计', classification: 'consumables', activeMenu: '/consumables/report/index' }
},
{
path: 'warehousinginfo',
name: 'standardWarehousingInfo',
component: () => import('@/views/reagent/report/warehousinginfo/index'),
hidden: true,
meta: { title: '入库信息查询', icon: '报表统计', classification: 'consumables', activeMenu: '/consumables/report/index' }
},
{
path: 'inventoryconsuminfo',
name: 'standardInventoryConsumInfo',
component: () => import('@/views/reagent/report/inventoryconsum/index'),
hidden: true,
meta: { title: '库存消耗', icon: '报表统计', classification: 'consumables', activeMenu: '/consumables/report/index' }
},
{
path: 'standardconsuminfo',
name: 'standardConsumInfo',
component: () => import('@/views/reagent/report/reagentconsum/index'),
hidden: true,
meta: { title: '耗材消耗', icon: '报表统计', classification: 'consumables', activeMenu: '/consumables/report/index' }
},
{
path: 'userconsuminfo',
name: 'standardUserConsumInfo',
component: () => import('@/views/reagent/report/userconsum/index'),
hidden: true,
meta: { title: '人员用量消耗', icon: '报表统计', classification: 'consumables', activeMenu: '/consumables/report/index' }
},
{
path: 'usefrequencyinfo',
name: 'standardUseFrequencyInfo',
component: () => import('@/views/reagent/report/usefrequency/index'),
hidden: true,
meta: { title: '使用频率', icon: '报表统计', classification: 'consumables', activeMenu: '/consumables/report/index' }
},
{
path: 'recordinfo/:t',
name: 'standardRecordInfo',
component: () => import('@/views/reagent/report/record/index'),
hidden: true,
meta: { title: '记录', icon: '报表统计', classification: 'consumables', activeMenu: '/consumables/report/index' }
}
]
},
{
path: '/consumables/warehousing',
component: Layout,
redirect: '/consumables/warehousing/index',
meta: { classification: 'consumables', module_code: 'DataReportIndex' },
children: [
{
path: 'index',
name: 'standardWarehousing',
component: () => import('@/views/reagent/warehousing/index'),
meta: { title: '耗材入库', icon: '试剂入库', classification: 'consumables' }
}
]
},
{
path: '/consumables/receiving',
component: Layout,
redirect: '/consumables/receiving/index',
meta: { classification: 'consumables', module_code: 'ConsumablesUseView' },
children: [
{
path: 'index',
name: 'standardReceiving',
component: () => import('@/views/reagent/receivingandreturn/index'),
meta: { title: '耗材领用', icon: '试剂领用', classification: 'consumables' }
}
]
},
{
path: '/consumables/sendback',
component: Layout,
redirect: '/consumables/sendback/index',
meta: { classification: 'consumables', module_code: 'ConsumablesReturnView' },
children: [
{
path: 'index',
name: 'standardSendBack',
component: () => import('@/views/reagent/receivingandreturn/index'),
meta: { title: '耗材归还', icon: '试剂归还', classification: 'consumables' }
}
]
},
{
path: '/consumables/weighing',
component: Layout,
redirect: '/consumables/weighing/index',
meta: { classification: 'consumables', module_code: 'ConsumablesWeigh' },
children: [
{
path: 'index',
name: 'standardweighing',
component: () => import('@/views/reagent/weighing/index'),
meta: { title: '耗材称重', icon: '试剂称重', classification: 'consumables' }
}
]
},
{
path: '/consumables/inventory',
component: Layout,
redirect: '/consumables/inventory/index',
meta: { classification: 'consumables', module_code: 'StockTakingIndex' },
children: [
{
path: 'index',
name: 'standardInventory',
component: () => import('@/views/reagent/inventory/index'),
meta: { title: '耗材盘点', icon: '库存盘点', classification: 'consumables' }
}
]
},
{
path: '/consumables/database',
component: Layout,
redirect: '/consumables/database/msds',
meta: { title: '化学品数据库', icon: '化学品数据库', classification: 'consumables', module_code: 'ChemicaDatabase' },
children: [
{
path: 'msds',
name: 'standardMSDS',
component: () => import('@/views/reagent/database/index'),
meta: { title: 'MSDS数据库', classification: 'consumables' }
},
{
path: 'dangerous',
name: 'standardDangerous',
component: () => import('@/views/reagent/database/index'),
meta: { title: '危化品数据库', classification: 'consumables' }
}
]
},
{
path: '/consumables/management',
component: Layout,
redirect: '/consumables/management/index',
meta: { classification: 'consumables', module_code: 'ConsumablesIndex' },
children: [
{
path: 'index',
name: 'standardManagement',
component: () => import('@/views/reagent/management/index'),
meta: { title: '耗材管理', icon: '试剂管理', classification: 'consumables' }
}
]
},
{
path: '/consumables/client',
component: Layout,
redirect: '/consumables/client/index',
meta: { classification: 'consumables', module_code: 'CabinetIndex' },
children: [
{
path: 'index',
name: 'standardClient',
component: () => import('@/views/reagent/client/index'),
meta: { title: '柜体管理', icon: '柜体管理', classification: 'consumables' }
}
]
},
{
path: '/consumables/envrecord',
component: Layout,
redirect: '/consumables/envrecord/index',
meta: { classification: 'consumables', module_code: 'HumitureIndex' },
children: [
{
path: 'index',
name: 'standardEnvRecord',
component: () => import('@/views/reagent/envrecord/index'),
meta: { title: '环境记录', icon: '雪花', classification: 'consumables' }
}
]
},
{
path: '/consumables/form',
component: Layout,
redirect: '/consumables/form/index',
meta: { classification: 'consumables', module_code: 'ConsumablesCustomForm' },
children: [
{
path: 'index',
name: 'standardForm',
component: () => import('@/views/reagent/customform/index'),
meta: { title: '耗材表单自定义', icon: '表单', classification: 'consumables' }
}
]
},
// {
// path: '/standard/buy',
// component: Layout,
// meta: { classification: 'standard' },
// children: [
// {
// path: 'index',
// name: 'Buy',
// component: () => import('@/views/reagent/buy/index'),
// meta: { title: '请购', icon: '请购', classification: 'standard' }
// }
// ]
// },
{
path: '/consumables/gotohome',
redirect: '/home',
meta: { title: '返回主页', icon: 'el-icon-arrow-left', classification: 'consumables' }
}
]
export default consumablesRouter

@ -1,260 +0,0 @@
import Layout from '@/layout'
const dangerousRouter = [
// {
// path: '/dangerous',
// hidden: true,
// redirect: '/dangerous/mainoverview/index',
// meta: { classification: 'dangerous', module_code: 'MainOverview' }
// },
{
path: '/dangerous/mainoverview',
component: Layout,
redirect: '/dangerous/mainoverview/index',
meta: { classification: 'dangerous', module_code: 'MainOverview' },
children: [
{
path: 'index',
name: 'dangerousMainOverview',
meta: { title: '主预览', icon: '主概览', classification: 'dangerous' },
component: () => import('@/views/reagent/mainoverview/index')
}
]
},
{
path: '/dangerous/report',
component: Layout,
redirect: '/dangerous/report/index',
meta: { classification: 'dangerous', module_code: 'DataReportIndex' },
children: [
{
path: 'index',
name: 'dangerousReport',
component: () => import('@/views/reagent/report/index'),
meta: { title: '报告统计', icon: '报表统计', classification: 'dangerous' }
},
{
path: 'storeinfo',
name: 'dangerousStoreInfo',
component: () => import('@/views/reagent/report/storeinfo/index'),
hidden: true,
meta: { title: '库存信息总览', icon: '报表统计', classification: 'dangerous', activeMenu: '/dangerous/report/index' }
},
{
path: 'dangerousinfo',
name: 'dangerousInfo',
component: () => import('@/views/reagent/report/reagentinfo/index'),
hidden: true,
meta: { title: '危化品信息详情', icon: '报表统计', classification: 'dangerous', activeMenu: '/dangerous/report/index' }
},
{
path: 'warehousinginfo',
name: 'dangerousWarehousingInfo',
component: () => import('@/views/reagent/report/warehousinginfo/index'),
hidden: true,
meta: { title: '入库信息查询', icon: '报表统计', classification: 'dangerous', activeMenu: '/dangerous/report/index' }
},
{
path: 'inventoryconsuminfo',
name: 'dangerousInventoryConsumInfo',
component: () => import('@/views/reagent/report/inventoryconsum/index'),
hidden: true,
meta: { title: '库存消耗', icon: '报表统计', classification: 'dangerous', activeMenu: '/dangerous/report/index' }
},
{
path: 'dangerousconsuminfo',
name: 'dangerousConsumInfo',
component: () => import('@/views/reagent/report/reagentconsum/index'),
hidden: true,
meta: { title: '危化品消耗', icon: '报表统计', classification: 'dangerous', activeMenu: '/dangerous/report/index' }
},
{
path: 'userconsuminfo',
name: 'dangerousUserConsumInfo',
component: () => import('@/views/reagent/report/userconsum/index'),
hidden: true,
meta: { title: '人员用量消耗', icon: '报表统计', classification: 'dangerous', activeMenu: '/dangerous/report/index' }
},
{
path: 'usefrequencyinfo',
name: 'dangerousUseFrequencyInfo',
component: () => import('@/views/reagent/report/usefrequency/index'),
hidden: true,
meta: { title: '使用频率', icon: '报表统计', classification: 'dangerous', activeMenu: '/dangerous/report/index' }
},
{
path: 'recordinfo/:t',
name: 'dangerousRecordInfo',
component: () => import('@/views/reagent/report/record/index'),
hidden: true,
meta: { title: '记录', icon: '报表统计', classification: 'dangerous', activeMenu: '/dangerous/report/index' }
}
]
},
{
path: '/dangerous/warehousing',
component: Layout,
redirect: '/dangerous/warehousing/index',
meta: { classification: 'dangerous', module_code: 'DataReportIndex' },
children: [
{
path: 'index',
name: 'dangerousWarehousing',
component: () => import('@/views/reagent/warehousing/index'),
meta: { title: '危化品入库', icon: '试剂入库', classification: 'dangerous' }
}
]
},
{
path: '/dangerous/receiving',
component: Layout,
redirect: '/dangerous/receiving/index',
meta: { classification: 'dangerous', module_code: 'DrugUseView' },
children: [
{
path: 'index',
name: 'dangerousReceiving',
component: () => import('@/views/reagent/receivingandreturn/index'),
meta: { title: '危化品领用', icon: '试剂领用', classification: 'dangerous' }
}
]
},
{
path: '/dangerous/sendback',
component: Layout,
redirect: '/dangerous/sendback/index',
meta: { classification: 'dangerous', module_code: 'DrugReturnView' },
children: [
{
path: 'index',
name: 'dangerousSendBack',
component: () => import('@/views/reagent/receivingandreturn/index'),
meta: { title: '危化品归还', icon: '试剂归还', classification: 'dangerous' }
}
]
},
{
path: '/dangerous/weighing',
component: Layout,
redirect: '/dangerous/weighing/index',
meta: { classification: 'dangerous', module_code: 'DrugWeigh' },
children: [
{
path: 'index',
name: 'dangerousweighing',
component: () => import('@/views/reagent/weighing/index'),
meta: { title: '危化品称重', icon: '试剂称重', classification: 'dangerous' }
}
]
},
{
path: '/dangerous/inventory',
component: Layout,
redirect: '/dangerous/inventory/index',
meta: { classification: 'dangerous', module_code: 'StockTakingIndex' },
children: [
{
path: 'index',
name: 'dangerousInventory',
component: () => import('@/views/reagent/inventory/index'),
meta: { title: '危化品盘点', icon: '库存盘点', classification: 'dangerous' }
}
]
},
{
path: '/dangerous/database',
component: Layout,
redirect: '/dangerous/database/msds',
meta: { title: '化学品数据库', icon: '化学品数据库', classification: 'dangerous', module_code: 'ChemicaDatabase' },
children: [
{
path: 'msds',
name: 'dangerousMSDS',
component: () => import('@/views/reagent/database/index'),
meta: { title: 'MSDS数据库', classification: 'dangerous' }
},
{
path: 'dangerous',
name: 'dangerousDangerous',
component: () => import('@/views/reagent/database/index'),
meta: { title: '危化品数据库', classification: 'dangerous' }
}
]
},
{
path: '/dangerous/management',
component: Layout,
redirect: '/dangerous/management/index',
meta: { classification: 'dangerous', module_code: 'DrugIndex' },
children: [
{
path: 'index',
name: 'dangerousManagement',
component: () => import('@/views/reagent/management/index'),
meta: { title: '危化品管理', icon: '试剂管理', classification: 'dangerous' }
}
]
},
{
path: '/dangerous/client',
component: Layout,
redirect: '/dangerous/client/index',
meta: { classification: 'dangerous', module_code: 'CabinetIndex' },
children: [
{
path: 'index',
name: 'dangerousClient',
component: () => import('@/views/reagent/client/index'),
meta: { title: '柜体管理', icon: '柜体管理', classification: 'dangerous' }
}
]
},
{
path: '/dangerous/envrecord',
component: Layout,
redirect: '/dangerous/envrecord/index',
meta: { classification: 'dangerous', module_code: 'HumitureIndex' },
children: [
{
path: 'index',
name: 'dangerousEnvRecord',
component: () => import('@/views/reagent/envrecord/index'),
meta: { title: '环境记录', icon: '雪花', classification: 'dangerous' }
}
]
},
{
path: '/dangerous/form',
component: Layout,
redirect: '/dangerous/form/index',
meta: { classification: 'dangerous', module_code: 'DrugCustomForm' },
children: [
{
path: 'index',
name: 'dangerousForm',
component: () => import('@/views/reagent/customform/index'),
meta: { title: '危化品表单自定义', icon: '表单', classification: 'dangerous' }
}
]
},
// {
// path: '/dangerous/buy',
// component: Layout,
// meta: { classification: 'dangerous' },
// children: [
// {
// path: 'index',
// name: 'Buy',
// component: () => import('@/views/reagent/buy/index'),
// meta: { title: '请购', icon: '请购', classification: 'dangerous' }
// }
// ]
// },
{
path: '/dangerous/gotohome',
redirect: '/home',
meta: { title: '返回主页', icon: 'el-icon-arrow-left', classification: 'dangerous' }
}
]
export default dangerousRouter

@ -0,0 +1,254 @@
import Layout from '@/layout'
// 仪器管理路由 instrument
const instrumentRouter = [
{
path: '/instrument/mainoverview',
component: Layout,
redirect: '/instrument/mainoverview/index',
meta: { classification: 'instrument', module_code: 'MainOverview' },
children: [
{
path: 'index',
name: 'standardMainOverview',
meta: { title: '主预览', icon: '主概览', classification: 'instrument' },
component: () => import('@/views/reagent/mainoverview/index')
}
]
},
{
path: '/instrument/report',
component: Layout,
redirect: '/instrument/report/index',
meta: { classification: 'instrument', module_code: 'DataReportIndex' },
children: [
{
path: 'index',
name: 'standardReport',
component: () => import('@/views/reagent/report/index'),
meta: { title: '报告统计', icon: '报表统计', classification: 'instrument' }
},
{
path: 'storeinfo',
name: 'standardStoreInfo',
component: () => import('@/views/reagent/report/storeinfo/index'),
hidden: true,
meta: { title: '库存信息总览', icon: '报表统计', classification: 'instrument', activeMenu: '/instrument/report/index' }
},
{
path: 'standardinfo',
name: 'standardInfo',
component: () => import('@/views/reagent/report/reagentinfo/index'),
hidden: true,
meta: { title: '仪器信息详情', icon: '报表统计', classification: 'instrument', activeMenu: '/instrument/report/index' }
},
{
path: 'warehousinginfo',
name: 'standardWarehousingInfo',
component: () => import('@/views/reagent/report/warehousinginfo/index'),
hidden: true,
meta: { title: '入库信息查询', icon: '报表统计', classification: 'instrument', activeMenu: '/instrument/report/index' }
},
{
path: 'inventoryconsuminfo',
name: 'standardInventoryConsumInfo',
component: () => import('@/views/reagent/report/inventoryconsum/index'),
hidden: true,
meta: { title: '库存消耗', icon: '报表统计', classification: 'instrument', activeMenu: '/instrument/report/index' }
},
{
path: 'standardconsuminfo',
name: 'standardConsumInfo',
component: () => import('@/views/reagent/report/reagentconsum/index'),
hidden: true,
meta: { title: '仪器消耗', icon: '报表统计', classification: 'instrument', activeMenu: '/instrument/report/index' }
},
{
path: 'userconsuminfo',
name: 'standardUserConsumInfo',
component: () => import('@/views/reagent/report/userconsum/index'),
hidden: true,
meta: { title: '人员用量消耗', icon: '报表统计', classification: 'instrument', activeMenu: '/instrument/report/index' }
},
{
path: 'usefrequencyinfo',
name: 'standardUseFrequencyInfo',
component: () => import('@/views/reagent/report/usefrequency/index'),
hidden: true,
meta: { title: '使用频率', icon: '报表统计', classification: 'instrument', activeMenu: '/instrument/report/index' }
},
{
path: 'recordinfo/:t',
name: 'standardRecordInfo',
component: () => import('@/views/reagent/report/record/index'),
hidden: true,
meta: { title: '记录', icon: '报表统计', classification: 'instrument', activeMenu: '/instrument/report/index' }
}
]
},
{
path: '/instrument/warehousing',
component: Layout,
redirect: '/instrument/warehousing/index',
meta: { classification: 'instrument', module_code: 'DataReportIndex' },
children: [
{
path: 'index',
name: 'standardWarehousing',
component: () => import('@/views/reagent/warehousing/index'),
meta: { title: '仪器入库', icon: '试剂入库', classification: 'instrument' }
}
]
},
{
path: '/instrument/receiving',
component: Layout,
redirect: '/instrument/receiving/index',
meta: { classification: 'instrument', module_code: 'InstrumentUseView' },
children: [
{
path: 'index',
name: 'standardReceiving',
component: () => import('@/views/reagent/receivingandreturn/index'),
meta: { title: '仪器领用', icon: '试剂领用', classification: 'instrument' }
}
]
},
{
path: '/instrument/sendback',
component: Layout,
redirect: '/instrument/sendback/index',
meta: { classification: 'instrument', module_code: 'InstrumentReturnView' },
children: [
{
path: 'index',
name: 'standardSendBack',
component: () => import('@/views/reagent/receivingandreturn/index'),
meta: { title: '仪器归还', icon: '试剂归还', classification: 'instrument' }
}
]
},
{
path: '/instrument/weighing',
component: Layout,
redirect: '/instrument/weighing/index',
meta: { classification: 'instrument', module_code: 'InstrumentWeigh' },
children: [
{
path: 'index',
name: 'standardweighing',
component: () => import('@/views/reagent/weighing/index'),
meta: { title: '仪器称重', icon: '试剂称重', classification: 'instrument' }
}
]
},
{
path: '/instrument/inventory',
component: Layout,
redirect: '/instrument/inventory/index',
meta: { classification: 'instrument', module_code: 'StockTakingIndex' },
children: [
{
path: 'index',
name: 'standardInventory',
component: () => import('@/views/reagent/inventory/index'),
meta: { title: '仪器盘点', icon: '库存盘点', classification: 'instrument' }
}
]
},
{
path: '/instrument/database',
component: Layout,
redirect: '/instrument/database/msds',
meta: { title: '化学品数据库', icon: '化学品数据库', classification: 'instrument', module_code: 'ChemicaDatabase' },
children: [
{
path: 'msds',
name: 'standardMSDS',
component: () => import('@/views/reagent/database/index'),
meta: { title: 'MSDS数据库', classification: 'instrument' }
},
{
path: 'dangerous',
name: 'standardDangerous',
component: () => import('@/views/reagent/database/index'),
meta: { title: '危化品数据库', classification: 'instrument' }
}
]
},
{
path: '/instrument/management',
component: Layout,
redirect: '/instrument/management/index',
meta: { classification: 'instrument', module_code: 'InstrumentIndex' },
children: [
{
path: 'index',
name: 'standardManagement',
component: () => import('@/views/reagent/management/index'),
meta: { title: '仪器管理', icon: '试剂管理', classification: 'instrument' }
}
]
},
{
path: '/instrument/client',
component: Layout,
redirect: '/instrument/client/index',
meta: { classification: 'instrument', module_code: 'CabinetIndex' },
children: [
{
path: 'index',
name: 'standardClient',
component: () => import('@/views/reagent/client/index'),
meta: { title: '柜体管理', icon: '柜体管理', classification: 'instrument' }
}
]
},
{
path: '/instrument/envrecord',
component: Layout,
redirect: '/instrument/envrecord/index',
meta: { classification: 'instrument', module_code: 'HumitureIndex' },
children: [
{
path: 'index',
name: 'standardEnvRecord',
component: () => import('@/views/reagent/envrecord/index'),
meta: { title: '环境记录', icon: '雪花', classification: 'instrument' }
}
]
},
{
path: '/instrument/form',
component: Layout,
redirect: '/instrument/form/index',
meta: { classification: 'instrument', module_code: 'InstrumentCustomForm' },
children: [
{
path: 'index',
name: 'standardForm',
component: () => import('@/views/reagent/customform/index'),
meta: { title: '仪器表单自定义', icon: '表单', classification: 'instrument' }
}
]
},
// {
// path: '/standard/buy',
// component: Layout,
// meta: { classification: 'standard' },
// children: [
// {
// path: 'index',
// name: 'Buy',
// component: () => import('@/views/reagent/buy/index'),
// meta: { title: '请购', icon: '请购', classification: 'standard' }
// }
// ]
// },
{
path: '/instrument/gotohome',
redirect: '/home',
meta: { title: '返回主页', icon: 'el-icon-arrow-left', classification: 'instrument' }
}
]
export default instrumentRouter

@ -1,12 +1,6 @@
import Layout from '@/layout' import Layout from '@/layout'
// 试剂管理路由
const reagentRouter = [ const reagentRouter = [
// {
// path: '/reagent',
// hidden: true,
// redirect: '/reagent/mainoverview/index',
// meta: { classification: 'reagent', module_code: 'MainOverview' }
// },
{ {
path: '/reagent/mainoverview', path: '/reagent/mainoverview',
component: Layout, component: Layout,
@ -15,7 +9,7 @@ const reagentRouter = [
children: [ children: [
{ {
path: 'index', path: 'index',
name: 'MainOverview', name: 'reagentMainOverview',
meta: { title: '主预览', icon: '主概览', classification: 'reagent' }, meta: { title: '主预览', icon: '主概览', classification: 'reagent' },
component: () => import('@/views/reagent/mainoverview/index') component: () => import('@/views/reagent/mainoverview/index')
} }
@ -185,7 +179,7 @@ const reagentRouter = [
path: '/reagent/management', path: '/reagent/management',
component: Layout, component: Layout,
redirect: '/reagent/management/index', redirect: '/reagent/management/index',
meta: { classification: 'reagent', module_code: 'DrugIndex' }, meta: { title: '试剂管理', icon: '试剂管理', classification: 'reagent', module_code: 'DrugIndex' },
children: [ children: [
{ {
path: 'index', path: 'index',

@ -1,12 +1,6 @@
import Layout from '@/layout' import Layout from '@/layout'
// 标准品管理路由
const standardRouter = [ const standardRouter = [
// {
// path: '/standard',
// hidden: true,
// redirect: '/reagent/mainoverview/index',
// meta: { classification: 'standard', module_code: 'MainOverview' }
// },
{ {
path: '/standard/mainoverview', path: '/standard/mainoverview',
component: Layout, component: Layout,
@ -109,7 +103,7 @@ const standardRouter = [
path: '/standard/receiving', path: '/standard/receiving',
component: Layout, component: Layout,
redirect: '/standard/receiving/index', redirect: '/standard/receiving/index',
meta: { classification: 'standard', module_code: 'DrugUseView' }, meta: { classification: 'standard', module_code: 'StandardUseView' },
children: [ children: [
{ {
path: 'index', path: 'index',
@ -123,7 +117,7 @@ const standardRouter = [
path: '/standard/sendback', path: '/standard/sendback',
component: Layout, component: Layout,
redirect: '/standard/sendback/index', redirect: '/standard/sendback/index',
meta: { classification: 'standard', module_code: 'DrugReturnView' }, meta: { classification: 'standard', module_code: 'StandardReturnView' },
children: [ children: [
{ {
path: 'index', path: 'index',
@ -137,7 +131,7 @@ const standardRouter = [
path: '/standard/weighing', path: '/standard/weighing',
component: Layout, component: Layout,
redirect: '/standard/weighing/index', redirect: '/standard/weighing/index',
meta: { classification: 'standard', module_code: 'DrugWeigh' }, meta: { classification: 'standard', module_code: 'StandardWeigh' },
children: [ children: [
{ {
path: 'index', path: 'index',
@ -185,13 +179,13 @@ const standardRouter = [
path: '/standard/management', path: '/standard/management',
component: Layout, component: Layout,
redirect: '/standard/management/index', redirect: '/standard/management/index',
meta: { classification: 'standard', module_code: 'DrugIndex' }, meta: { title: '标准品管理', icon: '试剂管理', classification: 'reagent', module_code: 'StandardIndex' },
children: [ children: [
{ {
path: 'index', path: 'index',
name: 'standardManagement', name: 'standardManagement',
component: () => import('@/views/reagent/management/index'), component: () => import('@/views/reagent/management/index'),
meta: { title: '标准品管理', icon: '试剂管理', classification: 'standard' } meta: { title: '标准品数据', icon: '试剂管理', classification: 'standard' }
} }
] ]
}, },
@ -227,7 +221,7 @@ const standardRouter = [
path: '/standard/form', path: '/standard/form',
component: Layout, component: Layout,
redirect: '/standard/form/index', redirect: '/standard/form/index',
meta: { classification: 'standard', module_code: 'DrugCustomForm' }, meta: { classification: 'standard', module_code: 'StandardCustomForm' },
children: [ children: [
{ {
path: 'index', path: 'index',

@ -10,6 +10,7 @@ const getters = {
isMain: state => state.settings.isMain, isMain: state => state.settings.isMain,
roleData: state => state.permission.roleData, roleData: state => state.permission.roleData,
opts: state => state.permission.opts, opts: state => state.permission.opts,
clientOptions: state => state.app.clientOptions clientOptions: state => state.app.clientOptions,
currentOptions: state => state.app.clientOptions[state.user.classification]
} }
export default getters export default getters

@ -4,11 +4,11 @@ const state = {
sidebar: { sidebar: {
// opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true, // opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true,
opened: true, opened: true,
withoutAnimation: false, withoutAnimation: false
clientOptions: []
}, },
device: 'desktop', device: 'desktop',
title: '' title: '',
clientOptions: {}
} }
const mutations = { const mutations = {
@ -30,6 +30,7 @@ const mutations = {
state.device = device state.device = device
}, },
SET_COPTS: (state, opt) => { SET_COPTS: (state, opt) => {
console.log(1010203240516, opt)
state.clientOptions = opt state.clientOptions = opt
}, },
SET_TITLE: (state, opt) => { SET_TITLE: (state, opt) => {

@ -20,6 +20,9 @@ const mutations = {
SET_NAME: (state, name) => { SET_NAME: (state, name) => {
state.name = name state.name = name
}, },
SET_ROLE_NAME: (state, name) => {
state.role_name = name
},
SET_AVATAR: (state, avatar) => { SET_AVATAR: (state, avatar) => {
state.avatar = avatar state.avatar = avatar
}, },

@ -0,0 +1,38 @@
// 引入路由和storage工具函数
import storage from '@/utils/localStorage'
import router from '@/router/index'
import store from '@/store/index'
let lastTime = new Date().getTime()
let currentTime = new Date().getTime()
const timeOut = 3 * 60 * 1000 // 设置超时时间: 3分钟
// const timeOut = 10000
window.onload = function() {
window.document.onmousedown = function() {
storage.setItem('lastTime', new Date().getTime())
}
}
function checkTimeout() {
console.log('checking .....')
currentTime = new Date().getTime() // 更新当前时间
lastTime = storage.getItem('lastTime')
if (currentTime - lastTime > timeOut) { // 判断是否超时
// 清除storage的数据(登陆信息和token)
console.log('超时!')
// 跳到登陆页
if (window.location.href.includes('login')) return // 当前已经是登陆页时不做跳转
store.commit('user/RESET_STATE')
store.commit('permission/RESET_STATE')
router.push('/login')
storage.clear()
}
}
export default function() {
/* 定时器 间隔30秒检测是否长时间未操作页面 */
return window.setInterval(checkTimeout, 60000)
// return window.setInterval(checkTimeout, 10000)
}

@ -5,7 +5,11 @@
import reagentRouter from '@/router/modules/reagent' import reagentRouter from '@/router/modules/reagent'
import userRouter from '@/router/modules/user' import userRouter from '@/router/modules/user'
import standardRouter from '@/router/modules/standard' import standardRouter from '@/router/modules/standard'
import dangerousRouter from '@/router/modules/dangerous' // import dangerousRouter from '@/router/modules/dangerous'
import consumablesRouter from '@/router/modules/consumables'
import instrumentRouter from '@/router/modules/instrument'
import store from '@/store' import store from '@/store'
/** /**
@ -162,6 +166,9 @@ export function filterAsyncRoutes(routers, roles) {
if (item.meta && item.meta.title === '返回主页') { if (item.meta && item.meta.title === '返回主页') {
return true return true
} }
if (item.meta && item.meta.module_code === 'MainOverview') {
return true
}
return !!roles.find(it => it.module_code === item.meta.module_code) return !!roles.find(it => it.module_code === item.meta.module_code)
}) })
} }
@ -169,14 +176,17 @@ export function filterAsyncRoutes(routers, roles) {
export function getALLRouter(data) { export function getALLRouter(data) {
// TODO: 其他路由都在此操作 // TODO: 其他路由都在此操作
const rasr = filterAsyncRoutes(reagentRouter, data.drug_manage) const rasr = filterAsyncRoutes(reagentRouter, data.drug_manage)
const uasr = filterAsyncRoutes(userRouter, data.drug_manage) const bzp = filterAsyncRoutes(standardRouter, data.standard_manage)
const hc = filterAsyncRoutes(consumablesRouter, data.consumables_manage)
const yq = filterAsyncRoutes(instrumentRouter, data.instrument_manage)
// const uasr = filterAsyncRoutes(userRouter, data.drug_manage)
// const standard = filterAsyncRoutes(standardRouter, data.drug_manage) // const standard = filterAsyncRoutes(standardRouter, data.drug_manage)
const asyncRoutes = [ const asyncRoutes = [
...userRouter,
...rasr, ...rasr,
...uasr, ...bzp,
// ...standard, ...hc,
...standardRouter, ...yq,
...dangerousRouter,
// 404 page must be placed at the end !!! // 404 page must be placed at the end !!!
{ path: '*', redirect: '/404', hidden: true } { path: '*', redirect: '/404', hidden: true }
] ]
@ -188,17 +198,22 @@ export function getALLRouter(data) {
}, },
{ {
name: 'standard', name: 'standard',
router: standardRouter[0], router: bzp[0],
title: '标准品管理' title: '标准品管理'
}, },
{ {
name: 'dangerous', name: 'consumables',
router: dangerousRouter[0], router: hc[0],
title: '危化品管理' title: '耗材管理'
},
{
name: 'instrument',
router: yq[0],
title: '仪器管理'
}, },
{ {
name: 'user', name: 'user',
router: uasr[0], router: userRouter[0],
title: '用户管理' title: '用户管理'
} }
] ]
@ -266,9 +281,26 @@ export const get_path = function(path) {
'reagent': 'reagent', 'reagent': 'reagent',
'user': 'user', 'user': 'user',
'standard': 'standard', 'standard': 'standard',
'dangerous': 'dangerous', 'consumables': 'consumables',
'instrument': 'instrument',
'userinfo': store.getters.classification 'userinfo': store.getters.classification
} }
return pathMap[pa] return pathMap[pa]
} }
/*
定义一个func_map,供后续使用
*/
export const func_map = {
'reagent': '1',
'standard': '2',
'consumables': '3',
'instrument': '4'
}
/*
不同路径得到不同的参数
*/
export const get_func_type = function() {
return func_map[store.getters.classification]
}

@ -0,0 +1,20 @@
export default {
setItem(key, value) {
value = JSON.stringify(value)
window.sessionStorage.setItem(key, value)
},
getItem(key, defaultValue) {
let value = window.sessionStorage.getItem(key)
try {
value = JSON.parse(value)
// eslint-disable-next-line no-empty
} catch (e) {}
return value || defaultValue
},
removeItem(key) {
window.sessionStorage.removeItem(key)
},
clear() {
window.sessionStorage.clear()
}
}

@ -2,7 +2,8 @@ const mapTitle = {
'reagent': '试剂', 'reagent': '试剂',
'user': 'user', 'user': 'user',
'standard': '标准品', 'standard': '标准品',
'dangerous': '危化品' 'consumables': '耗材',
'instrument': '仪器'
} }
export default mapTitle export default mapTitle

@ -2,7 +2,7 @@ import axios from 'axios'
import { MessageBox, Message } from 'element-ui' import { MessageBox, Message } from 'element-ui'
import store from '@/store' import store from '@/store'
import router from '@/router' import router from '@/router'
import { throttle } from '@/utils/index' import { get_func_type, throttle } from '@/utils/index'
// create an axios instance // create an axios instance
const service = axios.create({ const service = axios.create({
@ -33,6 +33,20 @@ service.interceptors.request.use(
// please modify it according to the actual situation // please modify it according to the actual situation
config.headers['Authorization'] = 'Bearer ' + store.getters.token config.headers['Authorization'] = 'Bearer ' + store.getters.token
} }
// 添加func_type参数
if (config.data) {
if (Object.prototype.toString.call(config.data) === '[object FormData]') {
if (config.data.get('func_type') === null) {
config.data.append('func_type', get_func_type())
}
} else {
config.data['func_type'] = get_func_type()
}
} else {
const formData = new FormData()
formData.append('func_type', get_func_type())
config.data = formData
}
return config return config
}, },
error => { error => {

@ -9,8 +9,8 @@
<div class="home-pic"> <div class="home-pic">
<div class="home-pic-item" @click="picClick('reagent')"><img src="@/assets/2-主界面/试剂管理.png" alt=""></div> <div class="home-pic-item" @click="picClick('reagent')"><img src="@/assets/2-主界面/试剂管理.png" alt=""></div>
<div key="2" class="home-pic-item" @click="picClick('standard')"><img src="@/assets/2-主界面/standard.png" alt=""></div> <div key="2" class="home-pic-item" @click="picClick('standard')"><img src="@/assets/2-主界面/standard.png" alt=""></div>
<div key="3" class="home-pic-item" @click="picClick('dangerous')"><img src="@/assets/2-主界面/危化品管理.png" alt=""></div> <div key="3" class="home-pic-item" @click="picClick('consumables')"><img src="@/assets/2-主界面/耗材管理.png" alt=""></div>
<!-- <div key="4" class="home-pic-item"><img src="@/assets/2-主界面/instrument.png" alt=""></div>--> <div key="4" class="home-pic-item" @click="picClick('instrument')"><img src="@/assets/2-主界面/instrument.png" alt=""></div>
<div key="5" class="home-pic-item" @click="picClick('user')"><img src="@/assets/2-主界面/用户管理.png" alt=""></div> <div key="5" class="home-pic-item" @click="picClick('user')"><img src="@/assets/2-主界面/用户管理.png" alt=""></div>
</div> </div>
<!-- <div class="home-menu">--> <!-- <div class="home-menu">-->

@ -107,6 +107,7 @@ import stringify from '@/utils/stringify'
import { faceStart, faceStop, login } from '@/api/user/user' import { faceStart, faceStop, login } from '@/api/user/user'
import { client_list } from '@/api/common' import { client_list } from '@/api/common'
// import { throttle } from '@/utils' // import { throttle } from '@/utils'
import { func_map } from '@/utils'
export default { export default {
name: 'Login', name: 'Login',
@ -178,13 +179,25 @@ export default {
if (res.status === 0) { if (res.status === 0) {
// //
this.$message.success(res.msg) this.$message.success(res.msg)
this.$store.commit('user/SET_TOKEN', res.data.token) const { user_info, token } = res.data
this.$store.commit('user/SET_ROLE_NAME', user_info.role_name)
this.$store.commit('user/SET_AVATAR', user_info.avatar_url || user_info.avatar_base64)
this.$store.commit('user/SET_NAME', user_info.real_name)
this.$store.commit('user/SET_TOKEN', token)
this.$store.dispatch('permission/generateRoutes') this.$store.dispatch('permission/generateRoutes')
this.$router.replace('/home') this.$router.replace('/home')
// client使 // client使
client_list().then( console.log('func_type:', func_map)
res => { Object.keys(func_map).forEach(
this.$store.commit('app/SET_COPTS', res.data.data_list) item => {
console.log('func_type:', item)
client_list(stringify({ 'func_type': func_map[item] })).then(
res => {
const cls = this.$store.getters.clientOptions
cls[item] = res.data.data_list
this.$store.commit('app/SET_COPTS', cls)
}
)
} }
) )
} else { } else {
@ -215,13 +228,28 @@ export default {
if (valid) { if (valid) {
this.loading = true this.loading = true
login(stringify(this.loginForm)).then(res => { login(stringify(this.loginForm)).then(res => {
this.$store.commit('user/SET_TOKEN', res.data.token) const { user_info, token } = res.data
this.$store.commit('user/SET_ROLE_NAME', user_info.role_name)
this.$store.commit('user/SET_AVATAR', user_info.avatar_url || user_info.avatar_base64)
this.$store.commit('user/SET_NAME', user_info.real_name)
this.$store.commit('user/SET_TOKEN', token)
this.$store.dispatch('permission/generateRoutes') this.$store.dispatch('permission/generateRoutes')
this.$router.replace('/home') this.$router.replace('/home')
// client使 // client使
client_list().then( // client使
res => { console.log('func_type:', func_map)
this.$store.commit('app/SET_COPTS', res.data.data_list) Object.keys(func_map).forEach(
item => {
console.log(func_map[item])
client_list(stringify({ 'func_type': func_map[item] })).then(
res => {
const cls = this.$store.getters.clientOptions
console.log(cls, 1233124124)
cls[item] = res.data.data_list
console.log(cls)
this.$store.commit('app/SET_COPTS', cls)
}
)
} }
) )
}).finally( }).finally(

@ -190,8 +190,8 @@
:value="item.id" :value="item.id"
/> />
</el-select> </el-select>
<el-button plain type="danger" @click="handleDrawUser"><svg-icon icon-class="" /> 确认禁用</el-button> <el-button plain type="danger" @click="handleDrawUser(1)"><svg-icon icon-class="" /> 确认禁用</el-button>
<el-button plain type="success" @click="handleDrawUser"><svg-icon icon-class="" /> 解除禁用</el-button> <el-button plain type="success" @click="handleDrawUser(0)"><svg-icon icon-class="" /> 解除禁用</el-button>
</div> </div>
<el-table <el-table
v-loading="loadingDraw" v-loading="loadingDraw"
@ -207,7 +207,9 @@
<el-table-column align="center" property="user_code" label="工号" /> <el-table-column align="center" property="user_code" label="工号" />
<el-table-column align="center" label="禁用状态"> <el-table-column align="center" label="禁用状态">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag :type="scope.row.drawer_type === 1?'danger':'success'">{{ scope.row.drawer_type === 1? '已禁用':'未禁用' }}</el-tag> <el-tag :type="scope.row.drawer_type === 1?'danger':'success'">
{{ scope.row.drawer_type === 1? '已禁用':'未禁用' }}
</el-tag>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -249,7 +251,9 @@
<el-table-column align="center" property="role_name" label="用户身份" /> <el-table-column align="center" property="role_name" label="用户身份" />
<el-table-column align="center" label="禁用状态"> <el-table-column align="center" label="禁用状态">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag :type="scope.row.status_type === 1?'danger':'success'">{{ scope.row.status_type === 1? '已禁用':'未禁用' }}</el-tag> <el-tag :type="scope.row.status_type === 1?'danger':'success'">
{{ scope.row.status_type === 1? '已禁用':'未禁用' }}
</el-tag>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -375,7 +379,9 @@ export default {
// client使 // client使
client_list().then( client_list().then(
res => { res => {
this.$store.commit('app/SET_COPTS', res.data.data_list) const cls = this.$store.getters.clientOptions
cls[this.$store.getters.classification] = res.data.data_list
this.$store.commit('app/SET_COPTS', cls)
} }
) )
}, },
@ -440,18 +446,23 @@ export default {
this.getUserList() this.getUserList()
}, },
// //
handleDrawUser() { handleDrawUser(d) {
if (this.multipleDrawSelection.length !== 1) { if (this.multipleDrawSelection.length !== 1) {
this.$message.warning('请选择一个用户!') this.$message.warning('请选择一个用户!')
return return
} }
const { user_id, drawer_type } = this.multipleDrawSelection[0] const { user_id } = this.multipleDrawSelection[0]
const data = { const data = {
// drawer_id: this.drawer_id,
// client_id: this.client_id,
// client_code: this.client_cell_code,
// client_cell_code: this.client_cell_code,
// drawer_user_info: JSON.stringify({ [user_id]: drawer_type === 0 ? 1 : 0 })
drawer_id: this.drawer_id, drawer_id: this.drawer_id,
client_id: this.client_id, client_id: this.client_id,
client_code: this.client_cell_code, // client_code: this.drawData.find(item => item.client_id === this.drawer_id).client_code,
client_cell_code: this.client_cell_code, client_cell_code: this.drawData.find(item => item.id === this.drawer_id).cell_code,
drawer_user_info: JSON.stringify({ [user_id]: drawer_type === 0 ? 1 : 0 }) drawer_user_info: JSON.stringify({ [user_id]: d })
} }
set_drawer_power(stringify(data)).then(res => { set_drawer_power(stringify(data)).then(res => {
this.$message.success(res.msg) this.$message.success(res.msg)
@ -473,7 +484,7 @@ export default {
this.$message.warning('请选择一个柜体!') this.$message.warning('请选择一个柜体!')
return return
} }
this.client_id = this.multipleSelection[0].client_id // this.client_id = this.multipleSelection[0].client_id
this.client_code = this.multipleSelection[0].client_code this.client_code = this.multipleSelection[0].client_code
this.loading = true this.loading = true
get_client_drawer(stringify({ client_id: this.client_id })).then( get_client_drawer(stringify({ client_id: this.client_id })).then(
@ -512,6 +523,7 @@ export default {
// //
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val this.multipleSelection = val
this.client_id = val[0].client_id
}, },
// //
pageChange(page) { pageChange(page) {

@ -7,7 +7,7 @@
<div class="header-sub"> <div class="header-sub">
<el-select v-model="client_id" placeholder="请选择柜体" @change="(val) => valueChange('id',val)"> <el-select v-model="client_id" placeholder="请选择柜体" @change="(val) => valueChange('id',val)">
<el-option <el-option
v-for="item in $store.getters.clientOptions" v-for="item in $store.getters.currentOptions"
:key="item.id" :key="item.id"
:label="item.client_name" :label="item.client_name"
:value="item.client_id" :value="item.client_id"
@ -41,7 +41,7 @@
<div class="header-sub"> <div class="header-sub">
<el-select v-model="daily_client_id" placeholder="请选择柜体"> <el-select v-model="daily_client_id" placeholder="请选择柜体">
<el-option <el-option
v-for="item in $store.getters.clientOptions" v-for="item in $store.getters.currentOptions"
:key="item.id" :key="item.id"
:label="item.client_name" :label="item.client_name"
:value="item.client_id" :value="item.client_id"
@ -56,7 +56,7 @@
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
/> />
<el-button type="primary" icon="el-icon-search" @click="getDailyData"></el-button> <el-button type="primary" icon="el-icon-search" @click="getDailyData"></el-button>
<el-button type="primary" icon="el-icon-download" plain>导出报表</el-button> <el-button type="primary" icon="el-icon-download" plain @click="handleExport"></el-button>
<el-button icon="el-icon-refresh" circle @click="getDailyData" /> <el-button icon="el-icon-refresh" circle @click="getDailyData" />
</div> </div>
</div> </div>
@ -119,7 +119,7 @@
value-format="HH:mm:ss" value-format="HH:mm:ss"
@change="changeValue" @change="changeValue"
/> />
<el-button style="float: right" type="primary" icon="el-icon-download" plain>导出报表</el-button> <el-button style="float: right" type="primary" icon="el-icon-download" plain @click="handleExportDay"></el-button>
</div> </div>
<el-table <el-table
v-loading="recordLoading" v-loading="recordLoading"
@ -169,6 +169,10 @@
import { get_monitoring_info } from '@/api/reagent/overView' import { get_monitoring_info } from '@/api/reagent/overView'
import stringify from '@/utils/stringify' import stringify from '@/utils/stringify'
import { day_monitor, day_monitor_info } from '@/api/reagent/envrecord' import { day_monitor, day_monitor_info } from '@/api/reagent/envrecord'
import {
dowload_day_monitor,
dowload_day_monitor_info,
click_dowload } from '@/api/reagent/dowload_file'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
export default { export default {
@ -187,7 +191,7 @@ export default {
headerStyle: { 'background': '#E6E6E6' }, headerStyle: { 'background': '#E6E6E6' },
// //
tableData: [], tableData: [],
loading: true, loading: false,
daily_client_id: undefined, daily_client_id: undefined,
value: '', value: '',
// //
@ -206,8 +210,10 @@ export default {
} }
}, },
created() { created() {
this.client_id = this.$store.getters.clientOptions[0].client_id if (this.$store.getters.currentOptions.length > 0) {
this.daily_client_id = this.client_id this.client_id = this.$store.getters.currentOptions[0].client_id
this.daily_client_id = this.client_id
}
this.getMonitoringData() this.getMonitoringData()
this.getDailyData() this.getDailyData()
this.initCharts() this.initCharts()
@ -218,9 +224,50 @@ export default {
}) })
}, },
methods: { methods: {
valueChange(t, value) { handleExportDay() {
this.getMonitoringData() const data = {
this.lineCharts(t) client_id: this.record_client_id,
start_time: this.start_time,
end_time: this.end_time,
page: this.record_page,
page_size: this.record_page_size,
download_type: 10,
file_name: '环境监测_时'
}
this.recordLoading = true
//
dowload_day_monitor_info(data).then(
res => {
this.$message.success(res.statusText)
click_dowload(data, res)
}
).finally(() => { this.recordLoading = false })
},
handleExport() {
const data = {
client_id: this.daily_client_id,
start_time: this.value ? this.value[0] : '',
end_time: this.value ? this.value[1] : '',
page: this.page,
page_size: this.page_size,
download_type: 9,
file_name: '环境监测_天'
}
// day_monitor(stringify(data)).then(
// res => {
// this.$message.success(res.msg)
// }
// )
//
dowload_day_monitor(data).then(
res => {
this.$message.success(res.statusText)
click_dowload(data, res)
}
)
},
valueChange(t, timeValue) {
this.getMonitoringData(t)
}, },
getDailyData() { getDailyData() {
const data = { const data = {
@ -238,7 +285,7 @@ export default {
this.loading = false this.loading = false
}) })
}, },
getMonitoringData() { getMonitoringData(t) {
const data = { const data = {
client_id: this.client_id, client_id: this.client_id,
time_type: this.client_date, time_type: this.client_date,
@ -300,7 +347,7 @@ export default {
}, },
series: [ series: [
{ {
name: this.$store.getters.clientOptions.find(item => item.client_id === this.client_id).client_name, name: this.$store.getters.currentOptions.find(item => item.client_id === this.client_id).client_name,
type: 'line', type: 'line',
smooth: true, smooth: true,
data: this.linechartData.map(item => item.data_value), data: this.linechartData.map(item => item.data_value),

@ -1,5 +1,5 @@
<template> <template>
<router-view :key="$route.path"/> <router-view :key="$route.path" />
</template> </template>
<script> <script>

@ -16,7 +16,7 @@
<div> <div>
<el-select v-model="client_id" placeholder="请选择柜体" @change="(val) => valueChange('id',val)"> <el-select v-model="client_id" placeholder="请选择柜体" @change="(val) => valueChange('id',val)">
<el-option <el-option
v-for="item in $store.getters.clientOptions" v-for="item in $store.getters.currentOptions"
:key="item.id" :key="item.id"
:label="item.client_name" :label="item.client_name"
:value="item.client_id" :value="item.client_id"
@ -79,7 +79,7 @@
@change="remainingPageChange(1)" @change="remainingPageChange(1)"
> >
<el-option <el-option
v-for="item in $store.getters.clientOptions" v-for="item in $store.getters.currentOptions"
:key="item.client_id" :key="item.client_id"
:label="item.client_name" :label="item.client_name"
:value="item.client_id" :value="item.client_id"
@ -392,19 +392,21 @@ export default {
client_id: null, client_id: null,
client_date: 1, client_date: 1,
linechartData: [], linechartData: [],
loadingLineData: true loadingLineData: false
} }
}, },
created() { created() {
this.loading = true if (this.$store.getters.currentOptions.length > 0) {
this.client_id = this.$store.getters.clientOptions[0].client_id this.loading = true
this.rclient_id = this.client_id this.client_id = this.$store.getters.currentOptions[0].client_id
this.getMonitoringData() this.rclient_id = this.client_id
home_info().then(res => { this.getMonitoringData()
this.initDataFunc(res.data) home_info().then(res => {
this.initAllCharts() this.initDataFunc(res.data)
}).finally(() => (this.loading = false)) this.initAllCharts()
this.remainingPageChange(1) }).finally(() => (this.loading = false))
this.remainingPageChange(1)
}
}, },
beforeDestroy() { beforeDestroy() {
window.removeEventListener('resize', () => { window.removeEventListener('resize', () => {
@ -578,7 +580,7 @@ export default {
}, },
series: [ series: [
{ {
name: this.$store.getters.clientOptions.find(item => item.client_id === this.client_id).client_name, name: this.$store.getters.currentOptions.find(item => item.client_id === this.client_id).client_name,
type: 'line', type: 'line',
areaStyle: {}, areaStyle: {},
smooth: true, smooth: true,

File diff suppressed because it is too large Load Diff

@ -0,0 +1,167 @@
<template>
<div>
<el-row :gutter="15">
<el-form ref="elliquorForm" :model="formData" :rules="rules" size="medium" label-width="110px">
<el-col :span="12">
<el-form-item label="配置日期" prop="start_time">
<el-date-picker
v-model="formData.start_time"
style="width: 100%"
type="datetime"
placeholder="选择配置日期"
value-format="yyyy-MM-dd HH:mm:ss"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="有限期" prop="end_time">
<el-date-picker
v-model="formData.end_time"
style="width: 100%"
type="datetime"
placeholder="选择有限期"
value-format="yyyy-MM-dd HH:mm:ss"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="配置浓度" prop="purity">
<el-input v-model="formData.purity" placeholder="请输入配置浓度" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="溶剂" prop="solvent">
<el-input v-model="formData.solvent" placeholder="请输入溶剂" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="母液编码" prop="mother_liquor_code">
<el-input v-model="formData.mother_liquor_code" placeholder="请输入母液编码" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="配置依据" prop="basis">
<el-input v-model="formData.basis" placeholder="请输入配置依据" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="配置记录" prop="doc_log">
<el-input v-model="formData.doc_log" placeholder="请输入配置记录" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
</el-form>
</el-row>
<div style="text-align: center">
<!-- <el-button @click="onClose"></el-button> -->
<el-button type="primary" @click="handelConfirm"></el-button>
</div>
</div>
</template>
<script>
// import {
// // add_mother_liquor,
// // update_mother_liquor
// } from '@/api/reagent/management'
import { throttle } from '@/utils'
export default {
name: 'MotherLiquirForm',
// eslint-disable-next-line vue/require-prop-types
props: ['oldmotherliquor', 'handlefunc'],
data() {
return {
formData: {},
rules: {
start_time: [{
required: true,
message: '请输入配置日期',
trigger: 'blur'
}],
end_time: [{
required: true,
message: '请输入有限期',
trigger: 'blur'
}],
purity: [{
required: true,
message: '请输入配置浓度',
trigger: 'blur'
}],
solvent: [{
required: true,
message: '请输入溶剂',
trigger: 'blur'
}],
mother_liquor_code: [{
required: true,
message: '请输入母液编码',
trigger: 'blur'
}]
}
}
},
watch: {
oldmotherliquor: {
handler(newValue, oldValue) {
this.formData = { ...newValue }
},
deep: true,
immediate: true
}
},
methods: {
handelConfirm: throttle(function() {
this.$refs['elliquorForm'].validate(valid => {
if (valid) {
this.$emit('handlefunc', this.formData)
}
if (!valid) return
})
}, 2000),
//
strToDate(datestr) {
return new Date(datestr)
},
resetForm() {
this.$refs['elliquorForm'].resetFields()
}
}
}
</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: 12.5rem;
margin-right: 1rem;
}
.el-select {
margin-right: 1rem;
}
.header-right{
float: right;
}
}
}
.user-header {
margin-bottom: 1rem;
.el-input{
width: 150px;
margin-right: 1rem;
}
}
</style>

@ -0,0 +1,284 @@
<template>
<div class="main-container-text">
<div class="title">禁忌属性关系</div>
<div class="header">
<el-input v-model="name" clearable placeholder="请输入名称" />
<el-button type="primary" icon="el-icon-search" @click="getList"></el-button>
<el-button icon="el-icon-edit" @click="handleAdd"></el-button>
<el-button icon="el-icon-edit" @click="handleEdit"></el-button>
<div class="header-right">
<el-button icon="el-icon-delete" circle @click="handleDel" />
<el-button icon="el-icon-refresh" circle @click="handleRefresh" />
</div>
</div>
<el-table
ref="table"
v-loading="loading"
:data="tableData"
stripe
element-loading-text="拼命加载中"
: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="name1"
show-overflow-tooltip
label="试剂属性1"
align="center"
/>
<el-table-column
prop="name2"
show-overflow-tooltip
label="试剂属性2"
align="center"
/>
<el-table-column
prop="relation"
show-overflow-tooltip
label="关系"
align="center"
/>
<el-table-column
prop="description"
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"
:disabled="loading"
@current-change="pageChange"
/>
</div>
<el-dialog :title="formTitle" :visible.sync="formVisible" @close="onClose">
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="93px">
<el-form-item label="试剂属性1" prop="name1">
<el-input v-model="formData.name1" placeholder="请输入试剂属性1" clearable :style="{width: '100%'}" />
</el-form-item>
<el-form-item label="试剂属性2" prop="name2">
<el-input v-model="formData.name2" placeholder="请输入试剂属性2" clearable :style="{width: '100%'}" />
</el-form-item>
<el-form-item label="关系提示" prop="relation">
<el-input v-model="formData.relation" placeholder="请输入关系提示" clearable :style="{width: '100%'}" />
</el-form-item>
<el-form-item label="说明" prop="description">
<el-input
v-model="formData.description"
type="textarea"
placeholder="请输入说明"
:autosize="{minRows: 4, maxRows: 4}"
:style="{width: '100%'}"
/>
</el-form-item>
</el-form>
<div slot="footer" style="text-align: center">
<el-button @click="close"></el-button>
<el-button type="primary" @click="handelAddConfirm"></el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
relation_del,
relation_get, relation_update_add
} from '@/api/reagent/management'
import stringify from '@/utils/stringify'
export default {
name: 'Management',
data() {
return {
page: 1,
page_size: 15,
total: 0,
headerStyle: { 'background': '#E6E6E6' },
name: null,
multipleSelection: [],
tableData: [],
loading: true,
formVisible: false,
formTitle: undefined,
formData: {
id: undefined,
name1: undefined,
name2: undefined,
relation: undefined,
description: undefined
},
rules: {
name1: [{
required: true,
message: '请输入试剂属性1',
trigger: 'blur'
}],
name2: [{
required: true,
message: '请输入试剂属性2',
trigger: 'blur'
}],
relation: [{
required: true,
message: '请输入关系提示',
trigger: 'blur'
}],
description: undefined
}
}
},
created() {
this.getList()
},
methods: {
//
getList() {
this.loading = true
const data = {
page: this.page,
page_size: this.page_size,
seach_word: this.name
}
relation_get(stringify(data)).then(res => {
this.tableData = res.data.data_list
this.total = res.data.total_count
}).finally(() => { this.$refs['table'].doLayout(); this.loading = false })
},
handleDel() {
if (this.multipleSelection.length === 0) {
this.$message.warning('请选择一个试剂类目!')
return
}
this.$confirm('此操作将永久删除该试剂, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const data = {
id_list: JSON.stringify(this.multipleSelection.map(item => item.id))
}
relation_del(stringify(data)).then(res => {
this.$message.success(res.msg)
this.getList()
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
handleAdd() {
this.formVisible = true
this.formTitle = '新增试剂类别'
},
close() {
this.formVisible = false
},
//
handleRefresh() {
this.getList()
},
//
handleSelectionChange(val) {
this.multipleSelection = val
},
//
pageChange(page) {
this.page = page
this.getList()
},
//
handleEdit() {
if (this.multipleSelection.length !== 1) {
this.$message.warning(`请选择一个需要编辑的试剂类别!`)
return
}
this.formTitle = '编辑试剂类别'
// form
const row = this.multipleSelection[0]
Object.keys(this.formData).forEach(item => {
this.formData[item] = row[item]
})
this.formVisible = true
},
onClose() {
this.formVisible = false
this.formData = {
name1: undefined,
name2: undefined,
relation: undefined,
description: undefined
}
this.$refs['elForm'].resetFields()
},
handelAddConfirm() {
this.$refs['elForm'].validate(valid => {
if (!valid) return
const data = JSON.parse(JSON.stringify(this.formData))
relation_update_add(stringify(data)).then(res => {
this.$message.success(res.msg)
this.formVisible = false
this.getList()
})
// this.onClose()
})
}
}
}
</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: 12.5rem;
margin-right: 1rem;
}
.el-select {
margin-right: 1rem;
}
.header-right{
float: right;
}
}
}
.user-header {
margin-bottom: 1rem;
.el-input{
width: 150px;
margin-right: 1rem;
}
}
</style>

@ -0,0 +1,274 @@
<template>
<div class="main-container-text">
<div class="title">{{ $store.state.app.title }}禁忌</div>
<div class="header">
<el-input v-model="name" clearable placeholder="请输入名称" />
<el-button type="primary" icon="el-icon-search" @click="getList"></el-button>
<el-button icon="el-icon-edit" @click="handleAdd"></el-button>
<el-button icon="el-icon-edit" @click="handleEdit"></el-button>
<div class="header-right">
<el-button icon="el-icon-delete" circle @click="handleDel" />
<el-button icon="el-icon-refresh" circle @click="handleRefresh" />
</div>
</div>
<el-table
ref="table"
v-loading="loading"
:data="tableData"
stripe
element-loading-text="拼命加载中"
: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="name"
show-overflow-tooltip
label="试剂类名"
align="center"
/>
<el-table-column
prop="description"
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"
:disabled="loading"
@current-change="pageChange"
/>
</div>
<el-dialog :title="formTitle" :visible.sync="formVisible" @close="onClose">
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="93px">
<el-form-item label="试剂类名" prop="name">
<el-input v-model="formData.name" placeholder="请输入试剂类名" clearable :style="{width: '100%'}" />
</el-form-item>
<el-form-item label="属性标签" prop="description">
<el-select v-model="formData.description" placeholder="请选择属性标签" multiple clearable :style="{width: '100%'}">
<el-option
v-for="(item, index) in descriptionOptions"
:key="index"
:label="item.label"
:value="item.value"
:disabled="item.disabled"
/>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" style="text-align: center">
<el-button @click="close"></el-button>
<el-button type="primary" @click="handelAddConfirm"></el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
attribute_label_list,
drug_label_del, drug_label_get, drug_label_update_add
} from '@/api/reagent/management'
import stringify from '@/utils/stringify'
export default {
name: 'Management',
data() {
return {
page: 1,
page_size: 15,
total: 0,
headerStyle: { 'background': '#E6E6E6' },
name: null,
multipleSelection: [],
tableData: [],
loading: true,
formVisible: false,
formTitle: undefined,
formData: {
variety_id: undefined,
name: undefined,
description: []
},
rules: {
name: [{
required: true,
message: '请输入试剂类名',
trigger: 'blur'
}],
description: [{
required: true,
message: '请选择属性标签',
trigger: 'change'
}]
},
descriptionOptions: []
}
},
created() {
this.getList()
attribute_label_list().then(res => {
this.descriptionOptions = res.data.map(
item => {
return {
'label': item,
'value': item
}
}
)
})
},
methods: {
//
getList() {
this.loading = true
const data = {
page: this.page,
page_size: this.page_size,
seach_word: this.name
}
drug_label_get(stringify(data)).then(res => {
this.tableData = res.data.data_list
this.total = res.data.total_count
}).finally(() => { this.$refs['table'].doLayout(); this.loading = false })
},
handleDel() {
if (this.multipleSelection.length === 0) {
this.$message.warning('请选择一个试剂类目!')
return
}
this.$confirm('此操作将永久删除该试剂, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const data = {
id_list: JSON.stringify(this.multipleSelection.map(item => item.variety_id))
}
drug_label_del(stringify(data)).then(res => {
this.$message.success(res.msg)
this.getList()
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
handleAdd() {
this.formVisible = true
this.formTitle = '新增试剂类别'
},
close() {
this.formVisible = false
},
//
handleRefresh() {
this.getList()
},
//
handleSelectionChange(val) {
this.multipleSelection = val
},
//
pageChange(page) {
this.page = page
this.getList()
},
//
handleEdit() {
if (this.multipleSelection.length !== 1) {
this.$message.warning(`请选择一个需要编辑的试剂类别!`)
return
}
this.formTitle = '编辑试剂类别'
// form
const row = this.multipleSelection[0]
Object.keys(this.formData).forEach(item => {
this.formData[item] = row[item]
})
this.formData['description'] = this.formData['description'].split(',')
this.formVisible = true
},
onClose() {
this.formVisible = false
this.formData = {
variety_id: undefined,
name: undefined,
description: []
}
this.$refs['elForm'].resetFields()
},
handelAddConfirm() {
this.$refs['elForm'].validate(valid => {
if (!valid) return
const data = JSON.parse(JSON.stringify(this.formData))
data['description'] = data['description'].join(',')
data['id'] = data['variety_id']
delete data['variety_id']
drug_label_update_add(stringify(data)).then(res => {
this.$message.success(res.msg)
this.formVisible = false
this.getList()
})
// this.onClose()
})
}
}
}
</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: 12.5rem;
margin-right: 1rem;
}
.el-select {
margin-right: 1rem;
}
.header-right{
float: right;
}
}
}
.user-header {
margin-bottom: 1rem;
.el-input{
width: 150px;
margin-right: 1rem;
}
}
</style>

@ -0,0 +1,318 @@
<template>
<div class="main-container-text">
<div class="title">试剂分类</div>
<div class="header">
<el-input v-model="name" clearable placeholder="请输入名称" />
<el-button type="primary" icon="el-icon-search" @click="getList"></el-button>
<!-- <el-button type="primary" plain icon="el-icon-plus" @click="handleFormOpen('add')"></el-button> -->
<!-- <el-button type="danger" plain icon="el-icon-close" @click="handleEmpty"></el-button> -->
<div class="right">
<!-- <el-button icon="el-icon-delete" circle @click="handleDel" /> -->
<el-button icon="el-icon-refresh" circle @click="getList" />
</div>
</div>
<el-table
v-loading="loading"
:data="tableData"
element-loading-text="拼命加载中"
:header-cell-style="headerStyle"
height="69vh"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="index" width="50" />
<el-table-column prop="name" show-overflow-tooltip label="药剂名称" align="center" />
<el-table-column prop="english_name" show-overflow-tooltip label="英文名称" align="center" />
<el-table-column prop="cas_number" show-overflow-tooltip label="药剂cas码" align="center" />
<el-table-column prop="purity" label="纯度" align="center" />
<el-table-column prop="total" label="总量" align="center" />
<el-table-column prop="net_weight_unit" label="净含量单位" align="center" />
<el-table-column prop="net_weight" label="净含量" align="center" />
<el-table-column prop="inventory_warning_value" label="库存预警量" align="center" />
<el-table-column prop="shelf_life_warning_value" label="保质期到期提前预警天数" align="center" />
<el-table-column prop="use_days_warning_value" label="领用超期预警天数" align="center" />
<el-table-column prop="empty_count" label="空瓶数量" align="center" />
<el-table-column prop="use_count" label="当前领用数量" align="center" />
<el-table-column prop="normal_count" label="在库数量" align="center" />
<el-table-column prop="total_count" label="总数量" align="center" />
<el-table-column prop="create_date" label="创建日期" align="center" />
<el-table-column prop="create_user_name" label="创建用户名称" align="center" />
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button @click="handleFormEdit(scope.row)"></el-button>
</template>
</el-table-column>
</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"
:disabled="loading"
@current-change="pageChange"
/>
</div>
<el-dialog :title="dialogTitile" :close-on-click-modal="false" :visible.sync="dialogVisible" @close="onClose">
<el-row :gutter="15">
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="150px">
<el-col :span="24">
<el-form-item label="药剂名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入药剂名称" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="英文名称" prop="english_name">
<el-input v-model="formData.english_name" placeholder="请输入英文名称" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="药剂cas码" prop="cas_number">
<el-input v-model="formData.cas_number" placeholder="请输入药剂cas码" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="纯度" prop="purity">
<el-input v-model="formData.purity" placeholder="请输入纯度" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="总量" prop="total">
<el-input v-model="formData.total" placeholder="请输入总量" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="净含量单位" prop="net_weight_unit">
<el-input v-model="formData.net_weight_unit" placeholder="请输入净含量单位" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="净含量" prop="net_weight">
<el-input v-model="formData.net_weight" placeholder="请输入净含量" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="库存预警量" prop="inventory_warning_value">
<el-input v-model="formData.inventory_warning_value" placeholder="请输入库存预警量" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="保质期提前预警天数" prop="shelf_life_warning_value">
<el-input v-model="formData.shelf_life_warning_value" placeholder="请输入保质期到期提前预警天数" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="领用超期预警天数" prop="use_days_warning_value">
<el-input v-model="formData.use_days_warning_value" placeholder="请输入领用超期预警天数" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="空瓶数量" prop="empty_count">
<el-input v-model="formData.empty_count" placeholder="请输入空瓶数量" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="当前领用数量" prop="use_count">
<el-input v-model="formData.use_count" placeholder="请输入当前领用数量" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="在库数量" prop="normal_count">
<el-input v-model="formData.normal_count" placeholder="请输入在库数量" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="总数量" prop="total_count">
<el-input v-model="formData.total_count" placeholder="请输入总数量" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
</el-form>
</el-row>
<div slot="footer" style="text-align: center">
<el-button @click="onClose"></el-button>
<el-button type="primary" @click="handelConfirm"></el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import stringify from '@/utils/stringify'
// import {
// get_list,
// add_or_update,
// update_status,
// get_client_drawer,
// get_drawer_power,
// user_ban_relieve, set_drawer_power, user_ban_list, user_ban_confirm, del, client_empty
// } from '@/api/reagent/client'
// import { client_list } from '@/api/common'
import {
variety_get_list,
variety_update
} from '@/api/reagent/variety'
export default {
name: 'Client',
data() {
return {
page: 1,
page_size: 15,
total: 0,
name: '',
loading: false,
multipleSelection: [],
tableData: [],
headerStyle: { 'background': '#E6E6E6' },
formData: {},
rules: {
name: [{
required: true,
message: '请输入药剂名称',
trigger: 'blur'
}],
cas_number: [{
required: true,
message: '请输入药剂cas码',
trigger: 'blur'
}],
purity: [{
required: true,
message: '请输入纯度',
trigger: 'blur'
}],
total: [{
required: true,
message: '请输入总量',
trigger: 'blur'
}],
inventory_warning_value: [{
required: true,
message: '请输入库存预警量',
trigger: 'blur'
}],
shelf_life_warning_value: [{
required: true,
message: '请输入保质期到期提前预警天数',
trigger: 'blur'
}],
use_days_warning_value: [{
required: true,
message: '请输入领用超期预警天数',
trigger: 'blur'
}],
empty_count: [],
use_count: [],
normal_count: [],
total_count: []
},
dialogVisible: false,
dialogTitile: ''
}
},
created() {
this.getList()
},
destroyed() {
// client使
},
methods: {
// ,
handelConfirm() {
this.$refs['elForm'].validate(valid => {
if (!valid) return
const data = JSON.parse(JSON.stringify(this.formData))
variety_update(stringify(data)).then(res => {
this.$message.success(res.msg)
this.dialogVisible = false
this.getList()
})
})
},
// h
getList() {
this.loadingReagent = true
const data = {
seach_word: this.name
}
variety_get_list(stringify(data)).then(
res => {
this.tableData = res.data.data_list
this.total = res.data.total_count
}).finally(() => { this.loadingReagent = false })
},
handleFormEdit(row) {
this.dialogTitile = '编辑试剂品类信息'
this.formData = { ...row }
this.dialogVisible = true
},
//
handleSelectionChange(val) {
this.multipleSelection = val
},
//
pageChange(page) {
this.page = page
this.getList()
},
onClose() {
this.dialogVisible = false
this.formData = {}
this.$refs['elForm'].resetFields()
}
}
}
</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;
.right {
float: right;
}
.el-input {
width: 9.375rem;
margin-right: 1rem;
}
.el-select {
margin-right: 1rem;
}
.header-right {
float: right;
}
}
}
.user-header {
margin-bottom: 1rem;
.el-input {
width: 12.5rem;
margin-right: 1rem;
}
.el-select {
width: 12.5rem;
margin-right: 1rem;
}
}
</style>

@ -63,11 +63,11 @@
</div> </div>
<el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="40%"> <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="40%">
<el-radio-group v-model="place"> <el-radio-group v-model="place">
<el-radio :label="3">备选项1</el-radio> <el-radio
<el-radio :label="6">备选项2</el-radio> v-for="item in $store.getters.currentOptions"
<el-radio :label="9">备选项3</el-radio> :key="item.id"
<el-radio :label="12">备选项4</el-radio> :label="item.client_id"
<el-radio :label="19">备选项5</el-radio> >{{ item.client_name }}</el-radio>
</el-radio-group> </el-radio-group>
<div style="text-align: center"> <div style="text-align: center">
<el-button type="primary" @click="btnClick"></el-button> <el-button type="primary" @click="btnClick"></el-button>
@ -118,7 +118,7 @@ export default {
}, },
getCode(code) { getCode(code) {
this.barCode = code this.barCode = code
if (this.$route.name === 'Receiving') { if (this.$route.name.indexOf('Receiving') !== -1) {
use(stringify({ 'bar_code': this.barCode })).then(res => { use(stringify({ 'bar_code': this.barCode })).then(res => {
this.tableData.push(res.data) this.tableData.push(res.data)
this.$message.success(res.data.name + ' 试剂领用成功!') this.$message.success(res.data.name + ' 试剂领用成功!')

@ -22,7 +22,7 @@
<el-button type="primary" icon="el-icon-search" @click="searchReagent"></el-button> <el-button type="primary" icon="el-icon-search" @click="searchReagent"></el-button>
</div> </div>
<div class="header-right"> <div class="header-right">
<el-button type="primary" plain icon="el-icon-download">导出报告</el-button> <el-button type="primary" plain icon="el-icon-download" @click="handleExport"></el-button>
<el-button icon="el-icon-refresh" circle @click="getStoreInfo" /> <el-button icon="el-icon-refresh" circle @click="getStoreInfo" />
</div> </div>
</div> </div>
@ -60,6 +60,7 @@
<script> <script>
import { stock_loss_info } from '@/api/reagent/report' import { stock_loss_info } from '@/api/reagent/report'
import { dowload_stock_loss_info, click_dowload } from '@/api/reagent/dowload_file'
import stringify from '@/utils/stringify' import stringify from '@/utils/stringify'
export default { export default {
@ -81,6 +82,24 @@ export default {
this.getStoreInfo() this.getStoreInfo()
}, },
methods: { methods: {
//
handleExport() {
const data = {
seach_word: this.selectReagentValue,
start_time: this.start_time,
end_time: this.end_time,
page: this.page,
page_size: this.page_size,
download_type: 4,
file_name: '库存消耗'
}
dowload_stock_loss_info(data).then(
res => {
this.$message.success(res.statusText)
click_dowload(data, res)
}
)
},
// //
searchReagent() { searchReagent() {
this.pageChange(1) this.pageChange(1)

@ -22,7 +22,7 @@
<el-button type="primary" icon="el-icon-search" @click="searchReagent"></el-button> <el-button type="primary" icon="el-icon-search" @click="searchReagent"></el-button>
</div> </div>
<div class="header-right"> <div class="header-right">
<el-button type="primary" plain icon="el-icon-download">导出报告</el-button> <el-button type="primary" plain icon="el-icon-download" @click="handleExport"></el-button>
<el-button icon="el-icon-refresh" circle @click="getStoreInfo" /> <el-button icon="el-icon-refresh" circle @click="getStoreInfo" />
</div> </div>
</div> </div>
@ -63,6 +63,7 @@
<script> <script>
import { drug_use_expend } from '@/api/reagent/report' import { drug_use_expend } from '@/api/reagent/report'
import { dowload_drug_use_expend, click_dowload } from '@/api/reagent/dowload_file'
import stringify from '@/utils/stringify' import stringify from '@/utils/stringify'
export default { export default {
@ -84,6 +85,24 @@ export default {
this.getStoreInfo() this.getStoreInfo()
}, },
methods: { methods: {
//
handleExport() {
const data = {
seach_word: this.selectReagentValue,
start_time: this.start_time,
end_time: this.end_time,
page: this.page,
page_size: this.page_size,
download_type: 5,
file_name: '试剂用量消耗'
}
dowload_drug_use_expend(data).then(
res => {
this.$message.success(res.statusText)
click_dowload(data, res)
}
)
},
// //
searchReagent() { searchReagent() {
this.pageChange(1) this.pageChange(1)

@ -6,7 +6,7 @@
<el-button @click="$router.push(`/${$store.getters.classification}/report/index`)"></el-button> <el-button @click="$router.push(`/${$store.getters.classification}/report/index`)"></el-button>
<el-select v-model="client_id" clearable placeholder="请选择柜体"> <el-select v-model="client_id" clearable placeholder="请选择柜体">
<el-option <el-option
v-for="item in $store.getters.clientOptions" v-for="item in $store.getters.currentOptions"
:key="item.id" :key="item.id"
:label="item.client_name" :label="item.client_name"
:value="item.client_id" :value="item.client_id"
@ -46,7 +46,16 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" property="by_user_name" label="最后使用人" /> <el-table-column align="center" property="by_user_name" label="最后使用人" />
<el-table-column align="center" property="client_id" label="所属终端" /> <el-table-column align="center" property="client_id" label="所属终端">
<template slot-scope="scope">
<div v-if="$store.getters.currentOptions.find(item => item.client_id === scope.row.client_id)">
{{ $store.getters.currentOptions.find(item => item.client_id === scope.row.client_id).client_name }}
</div>
<div v-else>
{{ scope.row.client_id }}
</div>
</template>
</el-table-column>
</el-table> </el-table>
<div class="my-pagination" style="text-align: center"> <div class="my-pagination" style="text-align: center">
<el-pagination <el-pagination
@ -63,6 +72,7 @@
<script> <script>
import { drug_details_info } from '@/api/reagent/report' import { drug_details_info } from '@/api/reagent/report'
import { dowload_drug_details_info, click_dowload } from '@/api/reagent/dowload_file'
import stringify from '@/utils/stringify' import stringify from '@/utils/stringify'
export default { export default {
@ -85,6 +95,24 @@ export default {
this.getStoreInfo() this.getStoreInfo()
}, },
methods: { methods: {
//
handleExport() {
const data = {
seach_word: this.selectReagentValue,
client_id: this.client_id,
client_speci: this.client_speci,
page: this.page,
page_size: this.page_size,
download_type: 3,
file_name: '试剂信息详情'
}
dowload_drug_details_info(data).then(
res => {
this.$message.success(res.statusText)
click_dowload(data, res)
}
)
},
// //
searchReagent() { searchReagent() {
this.pageChange(1) this.pageChange(1)

@ -6,7 +6,7 @@
<el-button @click="$router.push(`/${$store.getters.classification}/report/index`)"></el-button> <el-button @click="$router.push(`/${$store.getters.classification}/report/index`)"></el-button>
<el-select v-model="client_id" clearable placeholder="请选择柜体"> <el-select v-model="client_id" clearable placeholder="请选择柜体">
<el-option <el-option
v-for="item in $store.getters.clientOptions" v-for="item in $store.getters.currentOptions"
:key="item.id" :key="item.id"
:label="item.client_name" :label="item.client_name"
:value="item.client_id" :value="item.client_id"
@ -41,7 +41,7 @@
</div> </div>
</div> </div>
<div class="header-right"> <div class="header-right">
<el-button type="primary" plain icon="el-icon-download">导出报告</el-button> <el-button type="primary" plain icon="el-icon-download" @click="handleExport"></el-button>
<el-button icon="el-icon-refresh" circle @click="getStoreInfo" /> <el-button icon="el-icon-refresh" circle @click="getStoreInfo" />
</div> </div>
</div> </div>
@ -69,8 +69,8 @@
<el-table-column align="center" property="create_user_name" label="操作人员" /> <el-table-column align="center" property="create_user_name" label="操作人员" />
<el-table-column align="center" property="client_id" label="所属终端"> <el-table-column align="center" property="client_id" label="所属终端">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="$store.getters.clientOptions.find(item => item.client_id === scope.row.client_id)"> <div v-if="$store.getters.currentOptions.find(item => item.client_id === scope.row.client_id)">
{{ $store.getters.clientOptions.find(item => item.client_id === scope.row.client_id).client_name }} {{ $store.getters.currentOptions.find(item => item.client_id === scope.row.client_id).client_name }}
</div> </div>
<div v-else> <div v-else>
{{ scope.row.client_id }} {{ scope.row.client_id }}
@ -93,6 +93,8 @@
<script> <script>
import { drug_log_type_info } from '@/api/reagent/report' import { drug_log_type_info } from '@/api/reagent/report'
import { dowload_drug_log_type_info, click_dowload } from '@/api/reagent/dowload_file'
import stringify from '@/utils/stringify' import stringify from '@/utils/stringify'
export default { export default {
@ -129,6 +131,27 @@ export default {
this.getStoreInfo() this.getStoreInfo()
}, },
methods: { methods: {
//
handleExport() {
const data = {
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,
download_type: 8,
file_name: this.titleMap[this.$route.params.t]
}
dowload_drug_log_type_info(data).then(
res => {
this.$message.success(res.statusText)
click_dowload(data, res)
})
},
// //
searchReagent() { searchReagent() {
this.pageChange(1) this.pageChange(1)

@ -8,7 +8,7 @@
<el-button type="primary" icon="el-icon-search" @click="searchReagent"></el-button> <el-button type="primary" icon="el-icon-search" @click="searchReagent"></el-button>
</div> </div>
<div class="header-right"> <div class="header-right">
<el-button type="primary" plain icon="el-icon-download">导出报告</el-button> <el-button type="primary" plain icon="el-icon-download" @click="handleExport"></el-button>
<el-button icon="el-icon-refresh" circle @click="getStoreInfo" /> <el-button icon="el-icon-refresh" circle @click="getStoreInfo" />
</div> </div>
</div> </div>
@ -28,8 +28,8 @@
<el-table-column align="center" property="sum_remain" label="在库剩余总质量(g)" /> <el-table-column align="center" property="sum_remain" label="在库剩余总质量(g)" />
<el-table-column align="center" property="client_id" label="所属终端" show-overflow-tooltip> <el-table-column align="center" property="client_id" label="所属终端" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="$store.getters.clientOptions.find(item => item.client_id === scope.row.client_id)"> <div v-if="$store.getters.currentOptions.find(item => item.client_id === scope.row.client_id)">
{{ $store.getters.clientOptions.find(item => item.client_id === scope.row.client_id).client_name }} {{ $store.getters.currentOptions.find(item => item.client_id === scope.row.client_id).client_name }}
</div> </div>
<div v-else> <div v-else>
{{ scope.row.client_id }} {{ scope.row.client_id }}
@ -52,6 +52,8 @@
<script> <script>
import { stock_data_info } from '@/api/reagent/report' import { stock_data_info } from '@/api/reagent/report'
import { dowload_stock_data_info, click_dowload } from '@/api/reagent/dowload_file'
import stringify from '@/utils/stringify' import stringify from '@/utils/stringify'
export default { export default {
name: 'StoreInfo', name: 'StoreInfo',
@ -70,6 +72,23 @@ export default {
this.getStoreInfo() this.getStoreInfo()
}, },
methods: { methods: {
//
handleExport() {
const data = {
name: this.selectReagentValue,
page: this.page,
page_size: this.page_size,
download_type: 1,
file_name: '库存信息总览'
}
// stock_data_info(stringify(data)).then(
dowload_stock_data_info(data).then(
res => {
this.$message.success(res.statusText)
click_dowload(data, res)
}
)
},
// //
searchReagent() { searchReagent() {
this.pageChange(1) this.pageChange(1)

@ -6,7 +6,7 @@
<el-button @click="$router.push(`/${$store.getters.classification}/report/index`)"></el-button> <el-button @click="$router.push(`/${$store.getters.classification}/report/index`)"></el-button>
<el-select v-model="client_id" clearable placeholder="请选择柜体"> <el-select v-model="client_id" clearable placeholder="请选择柜体">
<el-option <el-option
v-for="item in $store.getters.clientOptions" v-for="item in $store.getters.currentOptions"
:key="item.id" :key="item.id"
:label="item.client_name" :label="item.client_name"
:value="item.client_id" :value="item.client_id"
@ -54,8 +54,8 @@
<el-table-column align="center" property="sum_tp3" label="归还次数" /> <el-table-column align="center" property="sum_tp3" label="归还次数" />
<el-table-column align="center" property="client_id" label="所属终端"> <el-table-column align="center" property="client_id" label="所属终端">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="$store.getters.clientOptions.find(item => item.client_id === scope.row.client_id)"> <div v-if="$store.getters.currentOptions.find(item => item.client_id === scope.row.client_id)">
{{ $store.getters.clientOptions.find(item => item.client_id === scope.row.client_id).client_name }} {{ $store.getters.currentOptions.find(item => item.client_id === scope.row.client_id).client_name }}
</div> </div>
<div v-else> <div v-else>
{{ scope.row.client_id }} {{ scope.row.client_id }}
@ -78,6 +78,7 @@
<script> <script>
import { use_frequency } from '@/api/reagent/report' import { use_frequency } from '@/api/reagent/report'
import { dowload_use_frequency, click_dowload } from '@/api/reagent/dowload_file'
import stringify from '@/utils/stringify' import stringify from '@/utils/stringify'
export default { export default {
@ -100,8 +101,24 @@ export default {
this.getStoreInfo() this.getStoreInfo()
}, },
methods: { methods: {
getName(op, id) { //
handleExport() {
const data = {
seach_word: this.selectReagentValue,
client_id: this.client_id,
start_time: this.start_time,
end_time: this.end_time,
page: this.page,
page_size: this.page_size,
download_type: 7,
file_name: '使用频率'
}
dowload_use_frequency(data).then(
res => {
this.$message.success(res.statusText)
click_dowload(data, res)
}
)
}, },
// //
searchReagent() { searchReagent() {

@ -23,7 +23,7 @@
<el-button type="primary" icon="el-icon-search" @click="searchReagent"></el-button> <el-button type="primary" icon="el-icon-search" @click="searchReagent"></el-button>
</div> </div>
<div class="header-right"> <div class="header-right">
<el-button type="primary" plain icon="el-icon-download">导出报告</el-button> <el-button type="primary" plain icon="el-icon-download" @click="handleExport"></el-button>
<el-button icon="el-icon-refresh" circle @click="getStoreInfo" /> <el-button icon="el-icon-refresh" circle @click="getStoreInfo" />
</div> </div>
</div> </div>
@ -63,6 +63,7 @@
<script> <script>
import { drug_user_use_expend } from '@/api/reagent/report' import { drug_user_use_expend } from '@/api/reagent/report'
import { dowload_drug_user_use_expend, click_dowload } from '@/api/reagent/dowload_file'
import stringify from '@/utils/stringify' import stringify from '@/utils/stringify'
export default { export default {
@ -85,6 +86,24 @@ export default {
this.getStoreInfo() this.getStoreInfo()
}, },
methods: { methods: {
//
handleExport() {
const data = {
seach_user: this.seachUser,
start_time: this.start_time,
end_time: this.end_time,
page: this.page,
page_size: this.page_size,
download_type: 6,
file_name: '人员用量消耗'
}
dowload_drug_user_use_expend(data).then(
res => {
this.$message.success(res.statusText)
click_dowload(data, res)
}
)
},
// //
searchReagent() { searchReagent() {
this.pageChange(1) this.pageChange(1)

@ -23,7 +23,7 @@
<el-button type="primary" icon="el-icon-search" @click="searchReagent"></el-button> <el-button type="primary" icon="el-icon-search" @click="searchReagent"></el-button>
</div> </div>
<div class="header-right"> <div class="header-right">
<el-button type="primary" plain icon="el-icon-download">导出报告</el-button> <el-button type="primary" plain icon="el-icon-download" @click="handleExport"></el-button>
<el-button icon="el-icon-refresh" circle @click="getStoreInfo" /> <el-button icon="el-icon-refresh" circle @click="getStoreInfo" />
</div> </div>
</div> </div>
@ -62,6 +62,7 @@
<script> <script>
import { drug_details_info } from '@/api/reagent/report' import { drug_details_info } from '@/api/reagent/report'
import stringify from '@/utils/stringify' import stringify from '@/utils/stringify'
import { dowload_drug_details_info, click_dowload } from '@/api/reagent/dowload_file'
export default { export default {
name: 'WarehousingInfo', name: 'WarehousingInfo',
@ -83,6 +84,25 @@ export default {
this.getStoreInfo() this.getStoreInfo()
}, },
methods: { methods: {
//
handleExport() {
const data = {
seach_word: this.selectReagentValue,
manufacturer: this.value,
start_time: this.start_time,
end_time: this.end_time,
page: this.page,
page_size: this.page_size,
download_type: 2,
file_name: '入库信息查询'
}
dowload_drug_details_info(data).then(
res => {
this.$message.success(res.statusText)
click_dowload(data, res)
}
)
},
// //
searchReagent() { searchReagent() {
this.pageChange(1) this.pageChange(1)

@ -6,7 +6,7 @@
<!-- <el-button>返回上一级</el-button>--> <!-- <el-button>返回上一级</el-button>-->
<el-select v-model="client_id" clearable placeholder="请选择柜体" @change="getTmpList"> <el-select v-model="client_id" clearable placeholder="请选择柜体" @change="getTmpList">
<el-option <el-option
v-for="item in $store.getters.clientOptions" v-for="item in $store.getters.currentOptions"
:key="item.id" :key="item.id"
:label="item.client_name" :label="item.client_name"
:value="item.client_id" :value="item.client_id"
@ -16,7 +16,7 @@
<el-button type="primary" @click="handleBindToDB"></el-button> <el-button type="primary" @click="handleBindToDB"></el-button>
<el-button type="primary" plain @click="handleAddTmp('add')">+ {{ $store.state.app.title }}</el-button> <el-button type="primary" plain @click="handleAddTmp('add')">+ {{ $store.state.app.title }}</el-button>
<el-button @click="handleAddTmp('modify')"><i class="el-icon-edit" />编辑{{ $store.state.app.title }}模板</el-button> <el-button @click="handleAddTmp('modify')"><i class="el-icon-edit" />编辑{{ $store.state.app.title }}模板</el-button>
<el-button><i class="el-icon-printer" /> 打印模板条码</el-button> <el-button @click="handlePrintCode"><i class="el-icon-printer" /> 打印条码</el-button>
<el-button @click="handleImport"><i class="el-icon-folder-add" /> 导入入库模板</el-button> <el-button @click="handleImport"><i class="el-icon-folder-add" /> 导入入库模板</el-button>
<div class="right"> <div class="right">
<el-button icon="el-icon-delete" circle @click="handleDelTem" /> <el-button icon="el-icon-delete" circle @click="handleDelTem" />
@ -157,7 +157,7 @@
<el-input v-model="reagentAddTmpName" placeholder="请输入名称" /> <el-input v-model="reagentAddTmpName" placeholder="请输入名称" />
<el-select v-model="reagentAddClient" placeholder="请选择柜体"> <el-select v-model="reagentAddClient" placeholder="请选择柜体">
<el-option <el-option
v-for="item in $store.getters.clientOptions" v-for="item in $store.getters.currentOptions"
:key="item.id" :key="item.id"
:label="item.client_name" :label="item.client_name"
:value="item.client_id" :value="item.client_id"
@ -218,7 +218,7 @@
<div> <div>
<el-select v-model="client_id_input" placeholder="请选择柜体"> <el-select v-model="client_id_input" placeholder="请选择柜体">
<el-option <el-option
v-for="item in $store.getters.clientOptions" v-for="item in $store.getters.currentOptions"
:key="item.id" :key="item.id"
:label="item.client_name" :label="item.client_name"
:value="item.client_id" :value="item.client_id"
@ -262,6 +262,37 @@
<el-button type="primary" @click="handleSubFile"></el-button> <el-button type="primary" @click="handleSubFile"></el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 打印条码 -->
<el-dialog
title="打印条码"
:visible.sync="dialogVisible"
width="35%"
:close-on-click-modal="false"
@close="handlePringClose"
>
<el-row :gutter="15">
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="50px">
<el-col :span="12">
<el-form-item label="起始" prop="start_code">
<el-input
v-model.number="formData.start_code"
placeholder="请输入起始条码"
clearable
:style="{width: '100%'}"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结束" prop="end_code">
<el-input v-model.number="formData.end_code" placeholder="请输入结束条码" clearable :style="{width: '100%'}" />
</el-form-item>
</el-col>
</el-form>
</el-row>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="doPrintCode"></el-button>
</div>
</el-dialog>
<Scanner @getcode="getCode" /> <Scanner @getcode="getCode" />
</div> </div>
</template> </template>
@ -276,7 +307,7 @@ import {
add_tmp, add_tmp,
del_tmp, del_tmp,
u_file_list, u_file_list,
put_in_tmp put_in_tmp, pring_bar_code
} from '@/api/reagent/warehousing' } from '@/api/reagent/warehousing'
import stringify from '@/utils/stringify' import stringify from '@/utils/stringify'
import { throttle } from '@/utils' import { throttle } from '@/utils'
@ -286,6 +317,24 @@ export default {
components: { ReagentForm, Scanner }, components: { ReagentForm, Scanner },
data() { data() {
return { return {
//
dialogVisible: false,
formData: {
start_code: undefined,
end_code: undefined
},
rules: {
start_code: [{
required: true,
message: '请输入起始条码',
trigger: 'blur'
}, { type: 'number', message: '条码必须为数字值' }],
end_code: [{
required: true,
message: '请输入结束条码',
trigger: 'blur'
}, { type: 'number', message: '条码必须为数字值' }]
},
dialogTableVisible: false, dialogTableVisible: false,
headerStyle: { 'background': '#E6E6E6' }, headerStyle: { 'background': '#E6E6E6' },
tableData: [], tableData: [],
@ -334,10 +383,32 @@ export default {
} }
}, },
created() { created() {
this.client_id = this.$store.getters.clientOptions[0].client_id if (this.$store.getters.currentOptions.length > 0) {
this.getTmpList() this.client_id = this.$store.getters.currentOptions[0].client_id
this.getTmpList()
}
}, },
methods: { methods: {
//
doPrintCode() {
this.$refs['elForm'].validate(valid => {
if (!valid) return
pring_bar_code(stringify(this.formData)).then(res => {
this.$message.success(res.msg)
})
})
},
//
handlePrintCode() {
this.dialogVisible = true
},
handlePringClose() {
this.formData = {
start_code: undefined,
end_code: undefined
}
this.$refs['elForm'].resetFields()
},
handleCloseToDB() { handleCloseToDB() {
this.client_id_input = '' this.client_id_input = ''
}, },
@ -365,7 +436,7 @@ export default {
'client_id': this.client_id_input 'client_id': this.client_id_input
})).then(res => { })).then(res => {
if (res.status === 0) { if (res.status === 0) {
this.bindToDBData[id].status = true this.$set(this.bindToDBData, id, { ...this.bindToDBData[id], status: true })
this.$message.success('入库成功!') this.$message.success('入库成功!')
// //
if (id < this.bindToDBData.length - 1) { if (id < this.bindToDBData.length - 1) {
@ -514,7 +585,10 @@ export default {
const data = this.multipleSelection[0] const data = this.multipleSelection[0]
this.reagentAddTmpName = data.template_name this.reagentAddTmpName = data.template_name
this.reagentAddClient = data.client_id this.reagentAddClient = data.client_id
this.reagentAddTmpData = JSON.parse(data.template_content) this.reagentAddTmpData = JSON.parse(data.template_content).map((v, index) => {
v['index'] = index
return v
})
this.reagentAddVisible = true this.reagentAddVisible = true
} else { } else {
this.$message.warning('请选择一个模板!') this.$message.warning('请选择一个模板!')
@ -525,7 +599,10 @@ export default {
const data = this.multipleSelection[0] const data = this.multipleSelection[0]
this.reagentAddTmpName = data.template_name this.reagentAddTmpName = data.template_name
this.reagentAddClient = data.client_id this.reagentAddClient = data.client_id
this.reagentAddTmpData = JSON.parse(data.template_content) this.reagentAddTmpData = JSON.parse(data.template_content).map((v, index) => {
v['index'] = index
return v
})
this.reagentAddVisible = true this.reagentAddVisible = true
} else { } else {
this.$message.warning('请选择一个模板!') this.$message.warning('请选择一个模板!')
@ -575,7 +652,7 @@ export default {
return return
} }
// //
this.reagentAddModifyIndex = this.reagentAddTmpData.find(item => this.reagentAddSelection[0] === item) this.reagentAddModifyIndex = this.reagentAddSelection[0].index
this.reagentAddFormdata = this.reagentAddSelection[0] this.reagentAddFormdata = this.reagentAddSelection[0]
this.reagentAddFormTitle = '编辑模板条目' this.reagentAddFormTitle = '编辑模板条目'
} }
@ -609,11 +686,19 @@ export default {
} }
this.bindToDBData = [] this.bindToDBData = []
this.multipleSelection.forEach(item => { this.multipleSelection.forEach(item => {
this.bindToDBData.push(...JSON.parse(item.template_content).map((item, index) => { const items = JSON.parse(item.template_content)
item.status = false items.forEach(item => {
item.index = index if (item.export_count) {
return item for (let i = 0; i < item.export_count; i++) {
})) this.bindToDBData.push({ ...item })
}
}
})
})
this.bindToDBData.map((item, index) => {
item.status = false
item.index = index
return item
}) })
if (this.multipleSelection.length === 1) { if (this.multipleSelection.length === 1) {
this.client_id_input = this.multipleSelection[0].client_id this.client_id_input = this.multipleSelection[0].client_id
@ -624,7 +709,6 @@ export default {
}) })
this.bindToDBVisible = true this.bindToDBVisible = true
} }
} }
} }
</script> </script>

@ -15,7 +15,7 @@
<div class="tip">精度0.01g±0.03g</div> <div class="tip">精度0.01g±0.03g</div>
<div class="show-data"> <div class="show-data">
<div class="top"> <div class="top">
<span class="num">{{ checkInputWeigh() ? parseFloat(inputWeigh).toFixed(2) : weight }}</span> <span class="num">{{ showWeigh }}</span>
<span class="unit">(g)</span> <span class="unit">(g)</span>
</div> </div>
<div class="bottom"> <div class="bottom">
@ -50,7 +50,14 @@
</template> </template>
</el-table-column> </el-table-column>
<el-descriptions-item label="是否监管">{{ infoData.is_supervise }}</el-descriptions-item> <el-descriptions-item label="是否监管">{{ infoData.is_supervise }}</el-descriptions-item>
<el-descriptions-item label="所属终端">{{ infoData.client_id }}</el-descriptions-item> <el-descriptions-item label="所属终端">
<div v-if="$store.getters.currentOptions.find(item => item.client_id === infoData.client_id)">
{{ $store.getters.currentOptions.find(item => item.client_id === infoData.client_id).client_name }}
</div>
<div v-else>
{{ infoData.client_id }}
</div>
</el-descriptions-item>
<el-descriptions-item label="最后使用人"> <el-descriptions-item label="最后使用人">
<el-tag v-if="infoData.by_user_name">{{ infoData.by_user_name }}</el-tag> <el-tag v-if="infoData.by_user_name">{{ infoData.by_user_name }}</el-tag>
</el-descriptions-item> </el-descriptions-item>
@ -85,6 +92,11 @@ export default {
surplusWeigh: '' surplusWeigh: ''
} }
}, },
computed: {
showWeigh() {
return this.checkInputWeigh() ? parseFloat(this.inputWeigh).toFixed(2) : this.weight
}
},
mounted() { mounted() {
// (1000*60*60=>**60) // (1000*60*60=>**60)
this.timer = setInterval(() => { this.timer = setInterval(() => {

@ -165,7 +165,7 @@
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="危化品管理" name="second"> <!-- <el-tab-pane label="危化品管理" name="second">
<el-checkbox <el-checkbox
v-model="checkAll_dangerous_module_id" v-model="checkAll_dangerous_module_id"
:indeterminate="isIndeterminate_dangerous_module_id" :indeterminate="isIndeterminate_dangerous_module_id"
@ -181,7 +181,8 @@
{{ item.module_name }} {{ item.module_name }}
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-tab-pane> </el-tab-pane> -->
<!-- 标准品管理 -->
<el-tab-pane label="标准品管理" name="third"> <el-tab-pane label="标准品管理" name="third">
<el-checkbox <el-checkbox
v-model="checkAll_standard_module_id" v-model="checkAll_standard_module_id"
@ -199,6 +200,42 @@
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-tab-pane> </el-tab-pane>
<!-- 耗材管理 -->
<el-tab-pane label="耗材管理" name="third">
<el-checkbox
v-model="checkAll_consumables_module_id"
:indeterminate="isIndeterminate_consumables_module_id"
@change="(val) =>handleCheckAllChange(val,'consumables_module_id')"
>全选
</el-checkbox>
<div style="margin: 15px 0;" />
<el-checkbox-group
v-model="formData.consumables_module_id"
@change="(val) =>handleCheckedCitiesChange(val,'consumables_module_id')"
>
<el-checkbox v-for="item in consumables_module_idOptions" :key="item.module_id" :label="item.module_id">
{{ item.module_name }}
</el-checkbox>
</el-checkbox-group>
</el-tab-pane>
<!-- 仪器管理 -->
<el-tab-pane label="仪器管理" name="third">
<el-checkbox
v-model="checkAll_instrument_module_id"
:indeterminate="isIndeterminate_instrument_module_id"
@change="(val) =>handleCheckAllChange(val,'instrument_module_id')"
>全选
</el-checkbox>
<div style="margin: 15px 0;" />
<el-checkbox-group
v-model="formData.instrument_module_id"
@change="(val) =>handleCheckedCitiesChange(val,'instrument_module_id')"
>
<el-checkbox v-for="item in instrument_module_idOptions" :key="item.module_id" :label="item.module_id">
{{ item.module_name }}
</el-checkbox>
</el-checkbox-group>
</el-tab-pane>
<el-tab-pane label="终端管理" name="fourth"> <el-tab-pane label="终端管理" name="fourth">
<el-checkbox <el-checkbox
v-model="checkAll_client_module_id" v-model="checkAll_client_module_id"
@ -270,12 +307,15 @@ export default {
return { return {
// //
checkAll_drug_module_id: false, checkAll_drug_module_id: false,
isIndeterminate_drug_module_id: true,
checkAll_dangerous_module_id: false,
isIndeterminate_dangerous_module_id: true,
checkAll_standard_module_id: false, checkAll_standard_module_id: false,
isIndeterminate_standard_module_id: true, checkAll_consumables_module_id: false,
checkAll_instrument_module_id: false,
checkAll_client_module_id: false, checkAll_client_module_id: false,
isIndeterminate_drug_module_id: true,
isIndeterminate_standard_module_id: true,
isIndeterminate_consumables_module_id: true,
isIndeterminate_instrument_module_id: true,
isIndeterminate_client_module_id: true, isIndeterminate_client_module_id: true,
tableData: [], tableData: [],
manageer: null, manageer: null,
@ -297,15 +337,24 @@ export default {
loading: false, loading: false,
roleData: [], roleData: [],
tabsLoading: false, tabsLoading: false,
/**
checkAll_drug_module_id: false,
checkAll_standard_module_id: false,
checkAll_consumables_module_id: false,
checkAll_instrument_module_id: false,
checkAll_client_module_id: false,
*/
drug_module_idOptions: [], drug_module_idOptions: [],
dangerous_module_idOptions: [],
standard_module_idOptions: [], standard_module_idOptions: [],
consumables_module_idOptions: [],
instrument_module_idOptions: [],
client_module_idOptions: [], client_module_idOptions: [],
formData: { formData: {
user_id: undefined, user_id: undefined,
drug_module_id: [], drug_module_id: [],
dangerous_module_id: [], consumables_module_id: [],
standard_module_id: [], standard_module_id: [],
instrument_module_id: [],
client_module_id: [] client_module_id: []
}, },
// //
@ -333,8 +382,9 @@ export default {
getModelList() { getModelList() {
get_module_list().then(res => { get_module_list().then(res => {
this.drug_module_idOptions = res.data.drug_manage this.drug_module_idOptions = res.data.drug_manage
this.dangerous_module_idOptions = res.data.dangerous_manage
this.standard_module_idOptions = res.data.standard_manage this.standard_module_idOptions = res.data.standard_manage
this.consumables_module_idOptions = res.data.consumables_manage
this.instrument_module_idOptions = res.data.instrument_manage
this.client_module_idOptions = res.data.client_manage this.client_module_idOptions = res.data.client_manage
}) })
}, },
@ -442,7 +492,8 @@ export default {
get_user_power_list(stringify({ 'user_id': row.user_id })).then(res => { get_user_power_list(stringify({ 'user_id': row.user_id })).then(res => {
this.formData.drug_module_id = res.data.drug_manage.filter(item => item.have === 1).map(item => item.module_id) this.formData.drug_module_id = res.data.drug_manage.filter(item => item.have === 1).map(item => item.module_id)
this.formData.standard_module_id = res.data.standard_manage.filter(item => item.have === 1).map(item => item.module_id) this.formData.standard_module_id = res.data.standard_manage.filter(item => item.have === 1).map(item => item.module_id)
this.formData.dangerous_module_id = res.data.dangerous_manage.filter(item => item.have === 1).map(item => item.module_id) this.formData.consumables_module_id = res.data.consumables_manage.filter(item => item.have === 1).map(item => item.module_id)
this.formData.instrument_module_id = res.data.instrument_manage.filter(item => item.have === 1).map(item => item.module_id)
this.formData.client_module_id = res.data.client_manage.filter(item => item.have === 1).map(item => item.module_id) this.formData.client_module_id = res.data.client_manage.filter(item => item.have === 1).map(item => item.module_id)
}).finally(() => { }).finally(() => {
this.tabsLoading = false this.tabsLoading = false
@ -489,7 +540,7 @@ export default {
data.standard_module_id = JSON.stringify(data.standard_module_id) data.standard_module_id = JSON.stringify(data.standard_module_id)
data.consumables_module_id = JSON.stringify(data.consumables_module_id) data.consumables_module_id = JSON.stringify(data.consumables_module_id)
data.instrument_module_id = JSON.stringify(data.instrument_module_id) data.instrument_module_id = JSON.stringify(data.instrument_module_id)
data.dangerous_module_id = JSON.stringify(data.dangerous_module_id) // data.dangerous_module_id = JSON.stringify(data.dangerous_module_id)
add_user_power(stringify(data)).then( add_user_power(stringify(data)).then(
res => { res => {
this.$message.success(res.msg) this.$message.success(res.msg)
@ -502,8 +553,9 @@ export default {
this.formData = { this.formData = {
user_id: undefined, user_id: undefined,
drug_module_id: [], drug_module_id: [],
dangerous_module_id: [],
standard_module_id: [], standard_module_id: [],
consumables_module_id: [],
instrument_module_id: [],
client_module_id: [] client_module_id: []
} }
}, },

@ -98,22 +98,33 @@
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col v-if="dangerous_module_idOptions.length !== 0"> <el-col v-if="standard_module_idOptions.length !== 0">
<el-form-item label="危化品权限" prop="dangerous_module_id"> <el-form-item label="标准品权限" prop="standard_module_id">
<el-checkbox-group v-model="formData.dangerous_module_id" size="medium"> <el-checkbox-group v-model="formData.standard_module_id" size="medium">
<el-checkbox <el-checkbox
v-for="item in dangerous_module_idOptions" v-for="item in standard_module_idOptions"
:key="item.module_id" :key="item.module_id"
:label="item.module_id" :label="item.module_id"
>{{ item.module_name }}</el-checkbox> >{{ item.module_name }}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col v-if="standard_module_idOptions.length !== 0"> <el-col v-if="consumables_module_idOptions.length !== 0">
<el-form-item label="标准品权限" prop="standard_module_id"> <el-form-item label="耗材权限" prop="consumables_module_id">
<el-checkbox-group v-model="formData.standard_module_id" size="medium"> <el-checkbox-group v-model="formData.consumables_module_id" size="medium">
<el-checkbox <el-checkbox
v-for="item in standard_module_idOptions" v-for="item in consumables_module_idOptions"
:key="item.module_id"
:label="item.module_id"
>{{ item.module_name }}</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
<el-col v-if="instrument_module_idOptions.length !== 0">
<el-form-item label="仪器权限" prop="instrument_module_id">
<el-checkbox-group v-model="formData.instrument_module_id" size="medium">
<el-checkbox
v-for="item in instrument_module_idOptions"
:key="item.module_id" :key="item.module_id"
:label="item.module_id" :label="item.module_id"
>{{ item.module_name }}</el-checkbox> >{{ item.module_name }}</el-checkbox>
@ -173,12 +184,16 @@ export default {
role_id: undefined, role_id: undefined,
role_code: undefined, role_code: undefined,
role_name: undefined, role_name: undefined,
//
drug_module_id: [], drug_module_id: [],
dangerous_module_id: [], //
standard_module_id: [], standard_module_id: [],
client_module_id: [], //
consumables_module_id: [], consumables_module_id: [],
//
instrument_module_id: [], instrument_module_id: [],
//
client_module_id: [],
description: undefined description: undefined
}, },
rules: { rules: {
@ -200,9 +215,10 @@ export default {
description: [] description: []
}, },
drug_module_idOptions: [], drug_module_idOptions: [],
dangerous_module_idOptions: [], client_module_idOptions: [],
standard_module_idOptions: [], standard_module_idOptions: [],
client_module_idOptions: [] consumables_module_idOptions: [],
instrument_module_idOptions: []
} }
}, },
created() { created() {
@ -224,9 +240,10 @@ export default {
getModelList() { getModelList() {
get_module_list().then(res => { get_module_list().then(res => {
this.drug_module_idOptions = res.data.drug_manage this.drug_module_idOptions = res.data.drug_manage
this.dangerous_module_idOptions = res.data.dangerous_manage
this.standard_module_idOptions = res.data.standard_manage
this.client_module_idOptions = res.data.client_manage this.client_module_idOptions = res.data.client_manage
this.standard_module_idOptions = res.data.standard_manage
this.consumables_module_idOptions = res.data.consumables_manage
this.instrument_module_idOptions = res.data.instrument_manage
}) })
}, },
pageChange(page) { pageChange(page) {
@ -279,8 +296,9 @@ export default {
res => { res => {
this.formData.client_module_id = res.data.filter(item => (item.have === 1 && item.module_type === '1')).map(item => item.module_id) this.formData.client_module_id = res.data.filter(item => (item.have === 1 && item.module_type === '1')).map(item => item.module_id)
this.formData.drug_module_id = res.data.filter(item => (item.have === 1 && item.module_type === '2')).map(item => item.module_id) this.formData.drug_module_id = res.data.filter(item => (item.have === 1 && item.module_type === '2')).map(item => item.module_id)
this.formData.dangerous_module_id = res.data.filter(item => item.have === 1 && item.module_type === '4').map(item => item.module_id)
this.formData.standard_module_id = res.data.filter(item => item.have === 1 && item.module_type === '3').map(item => item.module_id) this.formData.standard_module_id = res.data.filter(item => item.have === 1 && item.module_type === '3').map(item => item.module_id)
this.formData.consumables_module_id = res.data.filter(item => item.have === 1 && item.module_type === '4').map(item => item.module_id)
this.formData.instrument_module_id = res.data.filter(item => item.have === 1 && item.module_type === '5').map(item => item.module_id)
} }
).finally(() => { this.loadingForm = false }) ).finally(() => { this.loadingForm = false })
}, },
@ -290,9 +308,10 @@ export default {
role_code: undefined, role_code: undefined,
role_name: undefined, role_name: undefined,
drug_module_id: [], drug_module_id: [],
dangerous_module_id: [],
standard_module_id: [],
client_module_id: [], client_module_id: [],
standard_module_id: [],
consumables_module_id: [],
instrument_module_id: [],
description: undefined description: undefined
} }
this.$refs['elForm'].resetFields() this.$refs['elForm'].resetFields()
@ -305,9 +324,10 @@ export default {
if (!valid) return if (!valid) return
const data = JSON.parse(JSON.stringify(this.formData)) const data = JSON.parse(JSON.stringify(this.formData))
data.drug_module_id = JSON.stringify(data.drug_module_id) data.drug_module_id = JSON.stringify(data.drug_module_id)
data.dangerous_module_id = JSON.stringify(data.dangerous_module_id)
data.standard_module_id = JSON.stringify(data.standard_module_id)
data.client_module_id = JSON.stringify(data.client_module_id) data.client_module_id = JSON.stringify(data.client_module_id)
data.standard_module_id = JSON.stringify(data.standard_module_id)
data.consumables_module_id = JSON.stringify(data.consumables_module_id)
data.instrument_module_id = JSON.stringify(data.instrument_module_id)
add_update_role(stringify(data)).then(res => { add_update_role(stringify(data)).then(res => {
this.$message.success(res.msg) this.$message.success(res.msg)
this.getList() this.getList()

@ -128,6 +128,9 @@ export default {
this.$message.success(res.msg) this.$message.success(res.msg)
this.dialogVisible = false this.dialogVisible = false
this.getUserInfo() this.getUserInfo()
this.$store.commit('user/SET_ROLE_NAME', this.pdata.role_name)
this.$store.commit('user/SET_AVATAR', this.pdata.avatar_url || this.pdata.avatar_base64)
this.$store.commit('user/SET_NAME', this.pdata.real_name)
}) })
}, },
resetForm(formName) { resetForm(formName) {

Loading…
Cancel
Save