Browse Source

feat:[系统管理][存储位置]

ouqian
HanLong 1 month ago
parent
commit
9c304ac435
8 changed files with 355 additions and 4 deletions
  1. +24
    -0
      src/api/business/storageLocation/storageLocation.js
  2. +3
    -1
      src/lang/en.js
  3. +13
    -0
      src/lang/en/system/storageLocation.js
  4. +3
    -0
      src/lang/zh.js
  5. +13
    -0
      src/lang/zh/system/storageLocation.js
  6. +1
    -1
      src/utils/menu.js
  7. +296
    -0
      src/views/business/storageLocation/list.vue
  8. +2
    -2
      vue.config.js

+ 24
- 0
src/api/business/storageLocation/storageLocation.js View File

@ -0,0 +1,24 @@
import request from '@/utils/request'
export function storageLocation_list(query) {
return request({
url: '/system/business/storageLocation/list',
method: 'get',
params: query
})
}
export function storageLocation_add(data) {
return request({
url: '/system/business/storageLocation/save',
method: 'post',
data: data
})
}
export function storageLocation_edit(data) {
return request({
url: '/system/business/storageLocation/edit',
method: 'post',
data: data
})
}

+ 3
- 1
src/lang/en.js View File

@ -75,7 +75,8 @@ import gsp from './en/business/resource/gsp'
import archive from './en/business/archive/archive' import archive from './en/business/archive/archive'
//日志管理 //日志管理
import systemLog from './en/system/systemLog' import systemLog from './en/system/systemLog'
// 存储位置
import storageLocation from './en/system/storageLocation'
export default { export default {
system: { system: {
name: 'WestChina-Frontier PharmaTech ELN', name: 'WestChina-Frontier PharmaTech ELN',
@ -166,6 +167,7 @@ export default {
user, user,
template, template,
systemLog, systemLog,
storageLocation,
dict dict
}, },
business: { business: {

+ 13
- 0
src/lang/en/system/storageLocation.js View File

@ -0,0 +1,13 @@
export default {
fzdd: 'Location',
sbmc: 'Name or Id',
fzhj: 'Shelf placement',
wc: 'Compartment',
zt: 'Status',
ssbm: 'Department',
add: 'Add',
addStroageLocation: 'Add Storage Location',
editStroageLocation: 'Edit Storage Location',
no: 'disable',
yes: 'normal'
}

+ 3
- 0
src/lang/zh.js View File

@ -74,6 +74,8 @@ import gsp from './zh/business/resource/gsp'
import archive from './zh/business/archive/archive' import archive from './zh/business/archive/archive'
//日志管理 //日志管理
import systemLog from './zh/system/systemLog' import systemLog from './zh/system/systemLog'
//存储位置
import storageLocation from './zh/system/storageLocation'
export default { export default {
system: { system: {
@ -161,6 +163,7 @@ export default {
user, user,
template, template,
systemLog, systemLog,
storageLocation,
dict dict
}, },
business: { business: {

+ 13
- 0
src/lang/zh/system/storageLocation.js View File

@ -0,0 +1,13 @@
export default {
fzdd: '放置地点',
sbmc: '设备名称或编号',
fzhj: '放置货架',
wc: '温层',
zt: '状态',
ssbm: '所属部门',
add: '新增',
addStroageLocation: '新增存储位置',
editStroageLocation: '编辑存储位置',
no: '禁用',
yes: '正常'
}

+ 1
- 1
src/utils/menu.js View File

@ -35,7 +35,7 @@ let menuObj = {
模板管理: 'Function', 模板管理: 'Function',
字典管理: 'Term Book', 字典管理: 'Term Book',
日志管理: 'Log', 日志管理: 'Log',
存储位置: 'Storage Location',
字典数据: 'Term Book Data' 字典数据: 'Term Book Data'
} }
export function getMenuName(menuName) { export function getMenuName(menuName) {

+ 296
- 0
src/views/business/storageLocation/list.vue View File

@ -0,0 +1,296 @@
<!-- 存储位置列表 -->
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
<el-form-item :label="$t('page.system.storageLocation.fzdd') + ':'" prop="location">
<el-input v-model="queryParams.location" placeholder="" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('page.system.storageLocation.sbmc') + ':'" prop="name">
<el-input v-model="queryParams.name" placeholder="" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('page.system.storageLocation.fzhj') + ':'" prop="shelfPlacement">
<el-input v-model="queryParams.shelfPlacement" placeholder="" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item :label="$t('page.system.storageLocation.zt')" prop="status" >
<el-select v-model="queryParams.status" :placeholder="$t('form.placeholderSelect')" clearable @change="handleQuery">
<el-option key="1" :label="$t('page.system.storageLocation.no')" :value="1" />
<el-option key="10" :label="$t('page.system.storageLocation.yes')" :value="10" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t('form.search')
}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{ $t('form.reset') }}</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain @click="handleAdd" v-hasPermi="['business:storageLocation:add']">{{
$t('page.system.storageLocation.add') }}</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="list">
<el-table-column :label="$t('page.system.storageLocation.fzdd')" align="center" prop="location" />
<el-table-column :label="$t('page.system.storageLocation.sbmc')" align="center" prop="name" />
<el-table-column :label="$t('page.system.storageLocation.fzhj')" align="center" prop="shelfPlacement" />
<el-table-column :label="$t('page.system.storageLocation.wc')" align="center" prop="compartment" />
<el-table-column :label="$t('page.system.storageLocation.ssbm')" align="center" prop="deptName" />
<el-table-column :label="$t('page.system.storageLocation.zt')" align="center">
<template slot-scope="scope">
<span v-if="scope.row.status == 1">{{ $t('page.system.storageLocation.no') }}</span>
<span v-if="scope.row.status == 10">{{ $t('page.system.storageLocation.yes') }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('form.operate')" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.row)">{{
$t('form.detail') }}</el-button>
<el-button type="text" @click="handleUpdate(scope.row)" v-hasPermi="['business:storageLocation:edit']">{{
$t('form.edit') }}</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 添加或修改仪器管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.fzdd')" prop="location">
<el-input v-model="form.location" :placeholder="$t('form.placeholderInput')" maxlength="50" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.sbmc')" prop="name">
<el-input v-model="form.name" :placeholder="$t('form.placeholderInput')" maxlength="50" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.fzhj')" prop="shelfPlacement">
<el-input v-model="form.shelfPlacement" :placeholder="$t('form.placeholderInput')" maxlength="50" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.wc')" prop="compartment">
<BusinessSelect v-model="form.compartment" dictType="business_cctj"></BusinessSelect>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.ssbm')" prop="deptId">
<SelectDept v-model="form.deptId" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('page.system.storageLocation.zt')" prop="status">
<el-select v-model="form.status" :placeholder="$t('form.placeholderSelect')" style="width: 100%;">
<el-option key="1" :label="$t('page.system.storageLocation.no')" :value="1" />
<el-option key="10" :label="$t('page.system.storageLocation.yes')" :value="10" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('form.qmyy')" prop="qmyy">
<el-input v-model="form.qmyy" disabled :placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('form.signer')" prop="qmrmc">
<el-input v-model="nickName" disabled :placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('form.signerPsw')" prop="qmrmm">
<el-input v-model="form.qmrmm" autocomplete="off" auto-complete="new-password" show-password
:placeholder="$t('form.placeholderInput')" type="password" maxlength="20" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">{{ $t('form.saveConfirm') }}</el-button>
<el-button @click="cancel">{{ $t('form.cancel') }}</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { storageLocation_list, storageLocation_add } from '@/api/business/storageLocation/storageLocation'
import BusinessSelect from '@/views/business/comps/select/BusinessSelect';
import SelectDept from '@/views/business/comps/select/SelectDept';
import { mapGetters } from 'vuex'
import SelectStorageLocation from '@/views/business/comps/select/SelectStorageLocation'
export default {
name: 'StorageLocation',
components: { BusinessSelect, SelectDept, SelectStorageLocation },
data() {
return {
//
loading: true,
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: '',
//
open: false,
//
dateRange: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
location: null,
name: null,
shelfPlacement: null,
},
//
form: {
'qmyy': this.$t('page.form.add')
},
//
rules: {
location: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "change" },
{ min: 0, max: 50, message: this.$t('form.lengthLimit') + '50', trigger: 'blur' }
],
name: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "change" },
{ min: 0, max: 50, message: this.$t('form.lengthLimit') + '50', trigger: 'blur' }
],
shelfPlacement: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "change" },
{ min: 0, max: 50, message: this.$t('form.lengthLimit') + '50', trigger: 'blur' }
],
compartment: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "blur" }
],
deptId: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "change" },
],
status: [
{ required: true, message: this.$t('form.notEmpty'), trigger: "change" },
],
qmrmm: [
{ required: true, message: this.$t('form.signerPsw') + this.$t('form.notEmpty'), trigger: "change" },
{ min: 0, max: 20, message: this.$t('form.signerPsw') + this.$t('form.lengthLimit') + '20', trigger: 'blur' }
]
}
}
},
computed: {
...mapGetters([
'nickName', 'name'
]),
},
created() {
this.getList()
},
methods: {
/** 查询列表 */
getList() {
this.loading = true
storageLocation_list(this.queryParams).then((response) => {
this.list = response.rows
this.total = response.total
this.loading = false
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
id: null,
mc: null,
bh: null,
xh: null,
ly: null,
jzrq: null,
bmId: null,
wc: null,
ccwz: null,
fzdd: null,
qmyy: this.$t('page.system.storageLocation.addStroageLocation'),
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = []
this.resetForm('queryForm')
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = this.$t('form.add')
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
this.form = row
this.form.qmyy = this.$t('page.system.storageLocation.editStroageLocation')
this.open = true
this.title = this.$t('form.edit')
},
handleDetail(row) {
this.$refs.YqDetail.show(row)
},
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.id) {
storageLocation_edit(this.form).then((response) => {
this.$modal.msgSuccess(this.$t('form.operationSuccess'))
this.open = false
this.getList()
})
} else {
storageLocation_add(this.form).then((response) => {
this.$modal.msgSuccess(this.$t('form.operationSuccess'))
this.open = false
this.getList()
})
}
}
})
},
}
}
</script>

+ 2
- 2
vue.config.js View File

@ -34,8 +34,8 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
// target: `http://localhost:8080`,
target: `http://39.99.251.173:8080`,
target: `http://localhost:8080`,
// target: `http://39.99.251.173:8080`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''

Loading…
Cancel
Save