duizhaopin_ui
parent
8efef0ff67
commit
c7cef5d179
@ -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
|
||||
})
|
||||
}
|
@ -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]
|
||||
}
|
@ -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
|
@ -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)
|
||||
}
|
@ -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()
|
||||
}
|
||||
}
|
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>
|
Loading…
Reference in new issue