From dc1bfae4272fbe601f1534eeb66ebcd67648edf9 Mon Sep 17 00:00:00 2001 From: duan Date: Thu, 11 Aug 2022 17:49:17 +0800 Subject: [PATCH] =?UTF-8?q?refactor(index):=20=E9=A1=B5=E9=9D=A2=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/icons/svg/环境管理.svg | 31 +++ src/icons/svg/雪花.svg | 2 + src/layout/components/Sidebar/index.vue | 2 +- src/router/modules/reagent.js | 13 ++ src/store/modules/user.js | 43 ++-- src/styles/index.scss | 4 + src/utils/auth.js | 15 -- src/views/login/index.vue | 2 +- src/views/reagent/client/index.vue | 19 +- src/views/reagent/database/index.vue | 2 +- src/views/reagent/inventory/index.vue | 11 +- src/views/reagent/mainoverview/index.vue | 32 ++- src/views/reagent/management/index.vue | 206 ++++++++++-------- .../reagent/receivingandreturn/index.vue | 6 +- .../reagent/report/inventoryconsum/index.vue | 20 +- .../reagent/report/reagentconsum/index.vue | 22 +- .../reagent/report/reagentinfo/index.vue | 37 ++-- src/views/reagent/report/record/index.vue | 42 ++-- src/views/reagent/report/storeinfo/index.vue | 27 ++- .../reagent/report/usefrequency/index.vue | 30 ++- src/views/reagent/report/userconsum/index.vue | 16 +- .../reagent/report/warehousinginfo/index.vue | 25 ++- src/views/reagent/warehousing/index.vue | 15 +- src/views/user/index.vue | 16 +- src/views/user/role/index.vue | 5 +- 25 files changed, 385 insertions(+), 258 deletions(-) create mode 100644 src/icons/svg/环境管理.svg create mode 100644 src/icons/svg/雪花.svg delete mode 100644 src/utils/auth.js diff --git a/src/icons/svg/环境管理.svg b/src/icons/svg/环境管理.svg new file mode 100644 index 0000000..a877e00 --- /dev/null +++ b/src/icons/svg/环境管理.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + diff --git a/src/icons/svg/雪花.svg b/src/icons/svg/雪花.svg new file mode 100644 index 0000000..51e27dc --- /dev/null +++ b/src/icons/svg/雪花.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index 8617649..63414e9 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -87,7 +87,7 @@ export default { .user-role{ font-size: 12px; font-weight: 400; - color: #DCDFE6; + color: #AAAAAA; } } diff --git a/src/router/modules/reagent.js b/src/router/modules/reagent.js index feb181a..94135ac 100644 --- a/src/router/modules/reagent.js +++ b/src/router/modules/reagent.js @@ -200,6 +200,19 @@ const reagentRouter = [ } ] }, + { + path: '/reagent/envrecord', + component: Layout, + meta: { classification: 'reagent' }, + children: [ + { + path: 'index', + name: 'EnvRecord', + component: () => import('@/views/reagent/envrecord/index'), + meta: { title: '环境记录', icon: '雪花', classification: 'reagent' } + } + ] + }, { path: '/reagent/buy', component: Layout, diff --git a/src/store/modules/user.js b/src/store/modules/user.js index cd7545f..d47d067 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -1,10 +1,7 @@ -import { logout } from '@/api/user/user' -import { getToken, removeToken } from '@/utils/auth' -import { resetRouter } from '@/router' const getDefaultState = () => { return { - token: getToken(), + token: '', name: '', avatar: '', classification: '' @@ -69,27 +66,27 @@ const actions = { // }, // userinfo logout - logout({ commit, state }) { - return new Promise((resolve, reject) => { - logout(state.token).then(() => { - removeToken() // must remove token first - resetRouter() - commit('RESET_STATE') - resolve() - }).catch(error => { - reject(error) - }) - }) - }, + // logout({ commit, state }) { + // return new Promise((resolve, reject) => { + // logout(state.token).then(() => { + // removeToken() // must remove token first + // resetRouter() + // commit('RESET_STATE') + // resolve() + // }).catch(error => { + // reject(error) + // }) + // }) + // }, // remove token - resetToken({ commit }) { - return new Promise(resolve => { - removeToken() // must remove token first - commit('RESET_STATE') - resolve() - }) - } + // resetToken({ commit }) { + // return new Promise(resolve => { + // removeToken() // must remove token first + // commit('RESET_STATE') + // resolve() + // }) + // } } export default { diff --git a/src/styles/index.scss b/src/styles/index.scss index 42635c1..fbc8861 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -89,3 +89,7 @@ div:focus { border-radius: 20px; } +.my-pagination{ + margin-top: 1rem; +} + diff --git a/src/utils/auth.js b/src/utils/auth.js deleted file mode 100644 index 059af18..0000000 --- a/src/utils/auth.js +++ /dev/null @@ -1,15 +0,0 @@ -import Cookies from 'js-cookie' - -const TokenKey = 'vue_admin_template_token' - -export function getToken() { - return Cookies.get(TokenKey) -} - -export function setToken(token) { - return Cookies.set(TokenKey, token) -} - -export function removeToken() { - return Cookies.remove(TokenKey) -} diff --git a/src/views/login/index.vue b/src/views/login/index.vue index cacdf02..b301891 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -91,7 +91,7 @@ export default { // } return { backgrounddiv: { - 'background-image': 'url(' + require('@/assets/login/login_background.png') + ')' + 'background-image': 'url(' + require('@/assets/login/login.png') + ')' }, loginForm: { user_name: '', diff --git a/src/views/reagent/client/index.vue b/src/views/reagent/client/index.vue index eac4f7a..c280e03 100644 --- a/src/views/reagent/client/index.vue +++ b/src/views/reagent/client/index.vue @@ -2,7 +2,7 @@
柜体管理
- + 搜索 新增自定义柜体 柜体锁定/解锁 @@ -19,7 +19,7 @@ :data="tableData" element-loading-text="拼命加载中" :header-cell-style="headerStyle" - height="71vh" + height="69vh" @selection-change="handleSelectionChange" > -
+
@@ -212,13 +211,12 @@ -
+
- + 搜索 确认禁用 解除禁用 @@ -255,13 +253,12 @@ -
+
{{ $route.fullPath.indexOf('msds') !== -1 ? 'MSDS数据库' : '危化品数据库' }}
- + 搜索
最近搜索
diff --git a/src/views/reagent/inventory/index.vue b/src/views/reagent/inventory/index.vue index 4835f69..0c6ad7e 100644 --- a/src/views/reagent/inventory/index.vue +++ b/src/views/reagent/inventory/index.vue @@ -18,9 +18,10 @@
-
+
@@ -139,7 +139,7 @@ -
+
diff --git a/src/views/reagent/mainoverview/index.vue b/src/views/reagent/mainoverview/index.vue index a26a734..5695168 100644 --- a/src/views/reagent/mainoverview/index.vue +++ b/src/views/reagent/mainoverview/index.vue @@ -79,7 +79,8 @@ @@ -94,7 +95,7 @@ label="余量" /> -
+
@@ -121,6 +121,7 @@
-
+
- + - + 搜索
-
+
{ this.clientOptions = res.data.data_list this.client_id = this.clientOptions[0].client_id + this.rclient_id = this.client_id resolve() } ) @@ -681,4 +683,14 @@ export default { width: 65rem; height: 15.25rem; } +.header-custom{ + margin-bottom: 1rem; + .el-input{ + width: 12.5rem; + margin-right: 1rem; + } + .el-select{ + margin-right: 1rem; + } +} diff --git a/src/views/reagent/management/index.vue b/src/views/reagent/management/index.vue index 9750243..83e78ba 100644 --- a/src/views/reagent/management/index.vue +++ b/src/views/reagent/management/index.vue @@ -2,7 +2,7 @@
试剂管理
- + - + 搜索 设为空瓶 编辑试剂 @@ -24,9 +24,10 @@ - + + + + + - - + + + + + + + + + + -
+
@@ -141,24 +152,30 @@ :data="historyData" height="420" > + - + - + - + -
+
- + 搜索 确认禁用 解除禁用 @@ -184,6 +200,7 @@ :header-cell-style="headerStyle" :data="userData" height="420" + stripe @selection-change="handleUserSelectionChange" > @@ -201,13 +218,12 @@ -
+
- - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -315,16 +331,16 @@ - - - - - - - - - - + + + + + + + + + +
@@ -356,6 +372,7 @@ export default { page: 1, page_size: 15, total: 0, + recodeStatusMap: ['入库', '领用', '归还'], statusMap: ['在库', '出库', '空瓶'], statusColorMap: ['success', '', 'warning'], headerStyle: { 'background': '#E6E6E6' }, @@ -391,15 +408,15 @@ export default { shelf_life: undefined, production_date: '14:09:53', expiration_date: null, - use_days_warning_value: undefined, - shelf_life_warning_value: undefined, - inventory_warning_value: undefined, + // use_days_warning_value: undefined, + // shelf_life_warning_value: undefined, + // inventory_warning_value: undefined, speci: undefined, net_weight_unit: undefined, - net_weight: undefined, + net_weight: undefined // field115: undefined, - is_supervise: undefined, - is_weigh: undefined + // is_supervise: undefined, + // is_weigh: undefined }, rules: { name: [{ @@ -434,27 +451,27 @@ export default { message: '请选择过期日期', trigger: 'change' }], - use_days_warning_value: [{ - required: true, - message: '请输入出库预警天数', - trigger: 'blur' - }], - shelf_life_warning_value: [{ - required: true, - message: '请输入保质期预警天数', - trigger: 'blur' - }], - inventory_warning_value: [{ - required: true, - message: '请输入预警量', - trigger: 'blur' - }], + // use_days_warning_value: [{ + // required: true, + // message: '请输入出库预警天数', + // trigger: 'blur' + // }], + // shelf_life_warning_value: [{ + // required: true, + // message: '请输入保质期预警天数', + // trigger: 'blur' + // }], + // inventory_warning_value: [{ + // required: true, + // message: '请输入预警量', + // trigger: 'blur' + // }], speci: [], net_weight_unit: [], - net_weight: [], + net_weight: [] // field115: [], - is_supervise: [], - is_weigh: [] + // is_supervise: [], + // is_weigh: [] }, dialogEditVisible: false } @@ -483,7 +500,8 @@ export default { this.loadingHistory = true const data = { page: this.history_page, - page_size: this.history_page_size + page_size: this.history_page_size, + medicament_id: this.multipleSelection[0].medicament_id } get_durg_record(stringify(data)).then(res => { this.historyData = res.data.data_list @@ -492,6 +510,10 @@ export default { }, // 查看流转记录按钮click事件处理 showHistory() { + if (this.multipleSelection.length !== 1) { + this.$message.warning('请选择一个试剂!') + return + } this.dialogHistoryVisible = true this.getHistoryList() }, @@ -660,7 +682,7 @@ export default { .header{ margin: 1rem 0 1rem 0; .el-input{ - width: 9.375rem; + width: 12.5rem; margin-right: 1rem; } .el-select { diff --git a/src/views/reagent/receivingandreturn/index.vue b/src/views/reagent/receivingandreturn/index.vue index 8988594..72398bf 100644 --- a/src/views/reagent/receivingandreturn/index.vue +++ b/src/views/reagent/receivingandreturn/index.vue @@ -14,10 +14,11 @@
-
+
返回上一级 - + 搜索
- 导出报告 + 导出报告
@@ -29,10 +31,11 @@ element-loading-text="拼命加载中" :header-cell-style="headerStyle" :data="reagentData" - height="71vh" + height="69vh" + stripe > - - + + @@ -41,7 +44,7 @@ -
+
返回上一级 - + 搜索
- 导出报告 + 导出报告
@@ -29,22 +31,23 @@ element-loading-text="拼命加载中" :header-cell-style="headerStyle" :data="reagentData" - height="71vh" + height="69vh" + stripe > - - + + - + -
+
返回上一级 - + - + 搜索
- 导出报告 + 导出报告
@@ -25,24 +25,29 @@ element-loading-text="拼命加载中" :header-cell-style="headerStyle" :data="reagentData" - height="71vh" + height="69vh" + stripe > - - - + + + - - - + + + - - + + + + -
+
返回上一级 - + - + - - + +
- 导出报告 + 导出报告
@@ -48,12 +50,13 @@ element-loading-text="拼命加载中" :header-cell-style="headerStyle" :data="reagentData" - height="65vh" + height="63vh" + stripe > - - + + - + @@ -61,15 +64,20 @@ {{ statusMap[scope.row.status-1] }} - + -
+
diff --git a/src/views/reagent/report/storeinfo/index.vue b/src/views/reagent/report/storeinfo/index.vue index ad2af3b..3f36b0f 100644 --- a/src/views/reagent/report/storeinfo/index.vue +++ b/src/views/reagent/report/storeinfo/index.vue @@ -4,11 +4,11 @@
返回上一级 - + 搜索
- 导出报告 + 导出报告
@@ -17,16 +17,26 @@ element-loading-text="拼命加载中" :header-cell-style="headerStyle" :data="reagentData" - height="71vh" + height="69vh" + stripe > - + - + + + -
+
import { stock_data_info } from '@/api/reagent/report' import stringify from '@/utils/stringify' - +import { getClients } from '@/views/reagent/mixin/getClients' export default { name: 'StoreInfo', + mixins: [getClients], data() { return { selectReagentValue: '', @@ -104,7 +115,7 @@ export default { margin-bottom: 1rem; .header-left{ .el-input{ - width:170px; + width:200px; margin-right: 1rem; margin-left: 1rem; } diff --git a/src/views/reagent/report/usefrequency/index.vue b/src/views/reagent/report/usefrequency/index.vue index 2d20f2c..97f11cb 100644 --- a/src/views/reagent/report/usefrequency/index.vue +++ b/src/views/reagent/report/usefrequency/index.vue @@ -4,7 +4,7 @@
返回上一级 - + - + 搜索
- 导出报告 + 导出报告
@@ -37,10 +39,11 @@ element-loading-text="拼命加载中" :header-cell-style="headerStyle" :data="reagentData" - height="71vh" + height="69vh" + stripe > - - + + @@ -50,11 +53,16 @@ -
+
返回上一级 - + 搜索
- 导出报告 + 导出报告
@@ -30,7 +32,8 @@ element-loading-text="拼命加载中" :header-cell-style="headerStyle" :data="reagentData" - height="71vh" + height="69vh" + stripe > @@ -44,7 +47,7 @@ -
+
返回上一级 - - + + 搜索
- 导出报告 + 导出报告
@@ -30,19 +32,20 @@ element-loading-text="拼命加载中" :header-cell-style="headerStyle" :data="reagentData" - height="71vh" + height="69vh" + stripe > - - + + - - + + - + -
+
试剂入库
- 返回上一级 - + +
-
+
- + 搜索
@@ -115,7 +117,7 @@ -
+
用户管理
- - - + + + - + @@ -28,7 +28,7 @@ element-loading-text="拼命加载中" :data="tableData" :header-cell-style="headerStyle" - height="71vh" + height="69vh" @selection-change="handleSelectionChange" > -
+
@@ -424,10 +423,11 @@ export default { .header{ margin: 1rem 0 1rem 0; .el-input{ - width: 9.375rem; + width: 12.5rem; margin-right: 1rem; } .el-select { + width: 12.5rem; margin-right: 1rem; } .header-right{ diff --git a/src/views/user/role/index.vue b/src/views/user/role/index.vue index ab5ec6d..6e78c7c 100644 --- a/src/views/user/role/index.vue +++ b/src/views/user/role/index.vue @@ -13,7 +13,7 @@ element-loading-text="拼命加载中" :data="tableData" :header-cell-style="headerStyle" - height="71vh" + height="69vh" @selection-change="handleSelectionChange" > -
+