opt:修改国际化,add:增加大屏看板

This commit is contained in:
zhangzq
2025-10-28 14:11:19 +08:00
parent 9a85d1bd73
commit d87c5780c1
16 changed files with 396 additions and 402 deletions

View File

@@ -5,6 +5,7 @@ import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.nl.common.base.TableDataInfo;
import org.nl.common.logging.annotation.Log;
import org.nl.wms.bigscreen_manage.service.BigScreenService;
@@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
@@ -41,10 +43,12 @@ public class BigScreenController {
@Log("大屏数据")
@SaIgnore
public ResponseEntity<Object> getData(@RequestBody JSONObject stors) {
List<String> list = new ArrayList<>();
list.add("FJ");
List<JSONObject> data = bigScreenService.getData(list);
return new ResponseEntity<>(PdaResponse.requestParamOk(data.get(0)), HttpStatus.OK);
String storStr = stors.getString("stors");
List<JSONObject> data = new ArrayList<>();
if (!StringUtils.isEmpty(storStr)){
data = bigScreenService.getData(Arrays.asList(storStr.split(",")));
}
return new ResponseEntity<>(TableDataInfo.build(data), HttpStatus.OK);
}
}

View File

@@ -118,7 +118,7 @@ public class BigScreenServiceImpl implements BigScreenService {
// 空余货位
result.put("emp_qty", emp_qty);
// 使用货位百分比
double use_percentage = NumberUtil.mul(NumberUtil.div(use_qty, total_qty), 100);
double use_percentage = NumberUtil.mul(NumberUtil.div(use_qty, total_qty==0?1:total_qty), 100);
result.put("use_percentage", NumberUtil.round(use_percentage, 2));
return result;
}

View File

@@ -144,6 +144,8 @@ var config = {
'Tip19': 'Are you sure to delete the selected data?',
'Tip20': 'The login has expired,please log in again!',
"name": "Name",
"import": "import",
"export": "export",
"create_name": "Created By",
"create_time": "Creation Time",
"update_name": "Modified By",
@@ -171,7 +173,15 @@ var config = {
"yes": "Yes",
"no": "No",
"user_info_get_fail": "Failed to get user information",
"operation_success": "Operation successful"
"operation_success": "Operation successful",
"inputCodeOrName": "input code or name"
},
"upload": {
"load_text1": "Drag file here or",
"load_text2": "click to upload",
"load_text3": "Only Excel files can be uploaded, and no larger than 10MB",
"load_text4": "File is too large, please upload files smaller than 10MB~",
"load_text5": "Only one Excel file can be uploaded!"
},
"gateway": {
"picking_point_not_exist": "The picking point you entered does not exist, please enter 1207 or 1210 picking point!",
@@ -179,6 +189,19 @@ var config = {
"apply_task_fail": "Task application failed, application parameters are",
"check_error_log": "Please check the error log"
},
"md_me_materialbase": {
"material_code": "Material Code",
"material_name": "Material Name",
"product_series_name": "Product Series",
"material_spec": "Material Specification",
"material_model": "Material Model"
},
"md_pb_classstandard": {
"class_code": "Class Code",
"class_name": "Class Name",
"class_desc": "Class Description",
"parent_class_id": "Parent Class ID"
},
"md_pb_measureunit": {
"unit_code": "Code",
"unit_name": "Name",

View File

@@ -144,6 +144,8 @@ var config = {
'Tip19': 'Bạn có chắc chắn xóa dữ liệu đã chọn?',
'Tip20': 'Trạng thái đăng nhập hiện tại đã hết hạn, vui lòng đăng nhập lại!',
"name": "Tên",
"import": "Nhập",
"export": "Xuất",
"create_name": "Người tạo",
"create_time": "Thời gian tạo",
"update_name": "Người sửa đổi",
@@ -171,7 +173,15 @@ var config = {
"yes": "Có",
"no": "Không",
"user_info_get_fail": "Lấy thông tin người dùng thất bại",
"operation_success": "Thao tác thành công"
"operation_success": "Thao tác thành công",
"inputCodeOrName": "Nhập mã hoặc tên"
},
"upload": {
"load_text1": "Kéo file vào đây, hoặc",
"load_text2": "nhấp để tải lên",
"load_text3": "Chỉ có thể tải lên file Excel và không vượt quá 10MB",
"load_text4": "File quá lớn, vui lòng tải lên file nhỏ hơn 10MB~",
"load_text5": "Chỉ có thể tải lên một file excel!"
},
"gateway": {
"picking_point_not_exist": "Vị trí chọn bạn nhập không tồn tại, vui lòng nhập vị trí chọn 1207 hoặc 1210!",
@@ -179,6 +189,19 @@ var config = {
"apply_task_fail": "Ứng dụng tác vụ thất bại, tham số ứng dụng là",
"check_error_log": "Vui lòng kiểm tra nhật ký lỗi"
},
"md_me_materialbase": {
"material_code": "Mã vật liệu",
"material_name": "Tên vật liệu",
"product_series_name": "Dòng sản phẩm",
"material_spec": "Quy cách vật liệu",
"material_model": "Model vật liệu"
},
"md_pb_classstandard": {
"class_code": "Mã phân loại",
"class_name": "Tên phân loại",
"class_desc": "Mô tả phân loại",
"parent_class_id": "ID phân loại cấp trên"
},
"md_pb_measureunit": {
"unit_code": "Mã",
"unit_name": "Tên",

View File

@@ -144,6 +144,8 @@ var config = {
'Tip19': '你确定删除选中的数据吗?',
'Tip20': '当前登录状态已过期,请重新登录!',
"name": "名称",
"import": "导入",
"export": "导出",
"create_name": "创建人",
"create_time": "创建时间",
"update_name": "修改人",
@@ -171,7 +173,15 @@ var config = {
"yes": "是",
"no": "否",
"user_info_get_fail": "用户信息获取失败",
"operation_success": "操作成功"
"operation_success": "操作成功",
"inputCodeOrName": "输入编码或名称"
},
"upload":{
"load_text1":"将文件拖到此处,或",
"load_text2":"点击上传",
"load_text3":"只能上传Excel文件且不超过10MB",
"load_text4":"文件过大请上传小于10MB的文件〜",
"load_text5":"只能上传一个excel文件",
},
"gateway": {
"picking_point_not_exist": "您输入的拣选位不存在请输入1207或1210拣选位!",
@@ -179,6 +189,19 @@ var config = {
"apply_task_fail": "任务申请失败,申请参数为",
"check_error_log": "请查看错误日志"
},
"md_me_materialbase": {
"material_code": "物料编码",
"material_name": "物料名称",
"material_spec": "物料规格",
"material_model": "物料型号"
},
"md_pb_classstandard": {
"class_code": "分类编码",
"class_name": "分类名称",
"class_desc": "分类描述",
"product_series_name": "系列",
"parent_class_id": "上级分类标识"
},
"md_pb_measureunit": {
"unit_code": "编码",
"unit_name": "名称",

View File

@@ -1,5 +1,5 @@
import request from '@/utils/request'
// 国际化开发3。增加文件获取接口
export function fetchMessages(locale) {
return request({
url: '/api/language/js/' + locale,

View File

@@ -1,6 +1,6 @@
import Vue from 'vue'
import VueI18n from 'vue-i18n'
// 国际化开发5。i18n index文件修改
Vue.use(VueI18n)
// 准备默认的语言环境消息(可以是空对象,也可以是一些基本消息)

View File

@@ -50,10 +50,11 @@
<span class="el-dropdown-link" style="font-size: 18px">
{{ language }} <i class="el-icon-caret-bottom" />
</span>
<!-- 国际化开发1.修改语言列表-->
<el-dropdown-menu slot="dropdown">
<el-dropdown-item divided command="zh">简体中文</el-dropdown-item>
<el-dropdown-item divided command="en">English</el-dropdown-item>
<el-dropdown-item divided command="in">Indonesian</el-dropdown-item>
<el-dropdown-item divided command="iv">Vietnamese</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
@@ -137,13 +138,14 @@ export default {
this.setLang(command)
location.reload()
},
// 国际化开发2.设置
setLang(command) {
if (command === 'en') {
this.language = 'English'
} else if (command === 'zh') {
this.language = '简体中文'
} else if (command === 'in') {
this.language = 'Indonesian'
} else if (command === 'iv') {
this.language = 'Vietnamese'
}
},
toggleSideBar() {

View File

@@ -106,10 +106,10 @@ new Vue({
})
// add-xy start
// 异步获取语言文件
// 国际化开发3.调用接口异步获取语言文件增加api文件
fetchMessages(currentLocale).then(messages => {
// 将获取到的消息设置到i18n实例
i18n.setLocaleMessage(currentLocale, messages)
i18n.setLocaleMessage(currentLocale, messages.content)
// 设置当前语言
i18n.locale = currentLocale
})

View File

@@ -32,10 +32,11 @@
<span class="el-dropdown-link">
{{ language }}
</span>
<!-- 国际化开发1.修改语言列表-->
<el-dropdown-menu slot="dropdown">
<el-dropdown-item divided command="zh">简体中文</el-dropdown-item>
<el-dropdown-item divided command="en">English</el-dropdown-item>
<el-dropdown-item divided command="in">Indonesian</el-dropdown-item>
<el-dropdown-item divided command="iv">Vietnamese</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-col>
@@ -63,6 +64,7 @@ import { getCodeImg } from '@/api/login'
import Cookies from 'js-cookie'
import Background from '@/assets/images/background.jpg'
import i18n from '@/i18n'
import { fetchMessages } from '@/api/i18n'
export default {
name: 'Login',
data() {
@@ -113,12 +115,13 @@ export default {
// 如果已经加载过该语言,可以直接设置,避免重复请求
if (!this.$i18n.getLocaleMessage(locale)) {
const messages = await fetchMessages(locale)
this.$i18n.setLocaleMessage(locale, messages)
this.$i18n.setLocaleMessage(locale, messages.content)
}
this.$i18n.locale = locale
// 可以将当前语言保存到本地存储,以便下次使用
localStorage.setItem('lang', locale)
this.setLang(locale)
location.reload()
},
langChange(command) {
this.$i18n.locale = command
@@ -126,13 +129,14 @@ export default {
this.setLang(command)
location.reload()
},
// 国际化开发2.设置
setLang(command) {
if (command === 'en') {
this.language = 'English'
} else if (command === 'zh') {
this.language = '简体中文'
} else if (command === 'in') {
this.language = 'Indonesian'
} else if (command === 'iv') {
this.language = 'Vietnamese'
}
},
getCode() {

View File

@@ -4,9 +4,9 @@
src="/screen/index.html"
width="100%"
height="100%"
frameborder="0"
allowfullscreen
></iframe>
frameBorder="0"
allowFullScreen
/>
</div>
</template>
@@ -14,6 +14,7 @@
import ECharts from 'vue-echarts'
import 'echarts/lib/chart/line'
import 'echarts/lib/component/polar'
export default {
name: 'ServerMonitor',
components: {
@@ -94,12 +95,12 @@ export default {
}
},
created() {
/* this.init()
this.init()
this.monitor = window.setInterval(() => {
setTimeout(() => {
this.init()
}, 2)
}, 3500)*/
}, 3500)
},
destroyed() {
clearInterval(this.monitor)
@@ -126,41 +127,47 @@ export default {
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .box-card {
margin-bottom: 5px;
span {
margin-right: 28px;
}
.el-icon-refresh {
margin-right: 10px;
float: right;
cursor:pointer;
}
::v-deep .box-card {
margin-bottom: 5px;
span {
margin-right: 28px;
}
.cpu, .memory, .swap, .disk {
width: 20%;
float: left;
padding-bottom: 20px;
margin-right: 5%;
}
.title {
text-align: center;
font-size: 15px;
font-weight: 500;
color: #999;
margin-bottom: 16px;
}
.footer {
text-align: center;
font-size: 15px;
font-weight: 500;
color: #999;
margin-top: -5px;
margin-bottom: 10px;
}
.content {
text-align: center;
margin-top: 5px;
margin-bottom: 5px;
.el-icon-refresh {
margin-right: 10px;
float: right;
cursor: pointer;
}
}
.cpu, .memory, .swap, .disk {
width: 20%;
float: left;
padding-bottom: 20px;
margin-right: 5%;
}
.title {
text-align: center;
font-size: 15px;
font-weight: 500;
color: #999;
margin-bottom: 16px;
}
.footer {
text-align: center;
font-size: 15px;
font-weight: 500;
color: #999;
margin-top: -5px;
margin-bottom: 10px;
}
.content {
text-align: center;
margin-top: 5px;
margin-bottom: 5px;
}
</style>

View File

@@ -1,267 +1,173 @@
<template>
<div class="app-container">
<el-row>
<el-col :span="24" class="card-box">
<el-card>
<div slot="header">
<span>{{ $t('Redis.title1') }}</span>
</div>
<div class="el-table el-table--enable-row-hover el-table--medium">
<table cellspacing="0" style="width: 100%">
<tbody>
<tr>
<td><div class="cell">{{ $t('Redis.redis_version') }}:</div></td>
<td><div v-if="cache.info" class="cell">{{ cache.info.redis_version }}</div></td>
<td><div class="cell">{{ $t('Redis.redis_mode') }}:</div></td>
<td><div v-if="cache.info" class="cell">{{ cache.info.redis_mode == "standalone" ? $t('Redis.standalone') : $t('Redis.cluster') }}</div></td>
<td><div class="cell">{{ $t('Redis.tcp_port') }}:</div></td>
<td><div v-if="cache.info" class="cell">{{ cache.info.tcp_port }}</div></td>
<td><div class="cell">{{ $t('Redis.connected_clients') }}:</div></td>
<td><div v-if="cache.info" class="cell">{{ cache.info.connected_clients }}</div></td>
</tr>
<tr>
<td><div class="cell">{{ $t('Redis.running') }}:</div></td>
<td><div v-if="cache.info" class="cell">{{ cache.info.uptime_in_days }}</div></td>
<td><div class="cell">{{ $t('Redis.memory_use') }}:</div></td>
<td><div v-if="cache.info" class="cell">{{ cache.info.used_memory_human }}</div></td>
<td><div class="cell">{{ $t('Redis.cpu') }}:</div></td>
<td><div v-if="cache.info" class="cell">{{ parseFloat(cache.info.used_cpu_user_children).toFixed(2) }}</div></td>
<td><div class="cell">{{ $t('Redis.memory') }}:</div></td>
<td><div v-if="cache.info" class="cell">{{ cache.info.maxmemory_human }}</div></td>
</tr>
<tr>
<td><div class="cell">{{ $t('Redis.AOF') }}:</div></td>
<td><div v-if="cache.info" class="cell">{{ cache.info.aof_enabled === "0" ? $t('common.No') : $t('common.Yes') }}</div></td>
<td><div class="cell">{{ $t('Redis.RDB') }}:</div></td>
<td><div v-if="cache.info" class="cell">{{ cache.info.rdb_last_bgsave_status }}</div></td>
<td><div class="cell">{{ $t('Redis.keys') }}:</div></td>
<td><div v-if="cache.dbSize" class="cell">{{ cache.dbSize }} </div></td>
<td><div class="cell">{{ $t('Redis.io') }}:</div></td>
<td><div v-if="cache.info" class="cell">{{ cache.info.instantaneous_input_kbps }}kps/{{ cache.info.instantaneous_output_kbps }}kps</div></td>
</tr>
</tbody>
</table>
</div>
</el-card>
</el-col>
<el-col :span="12" class="card-box">
<el-card>
<div slot="header"><span>{{ $t('Redis.left_title') }}</span></div>
<div class="el-table el-table--enable-row-hover el-table--medium">
<div ref="commandstats" style="height: 420px" />
</div>
</el-card>
</el-col>
<el-col :span="12" class="card-box">
<el-card>
<div slot="header">
<span>{{ $t('Redis.right_title') }}</span>
</div>
<div class="el-table el-table--enable-row-hover el-table--medium">
<div ref="usedmemory" style="height: 420px" />
</div>
</el-card>
</el-col>
<el-col :span="24" class="card-box">
<el-card>
<el-button size="mini" :disabled="delBtlStatu" type="danger" style="margin-bottom: 10px" @click="batchDel">
{{ $t('Redis.batch_del') }}</el-button>
<el-table
:data="keyAndValues"
row-key="id"
:header-cell-style="{'text-align':'center'}"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column prop="key" label="Key" width="200" :show-overflow-tooltip="true" />
<el-table-column prop="dataType" :label="$t('Redis.key_type')" width="100" />
<el-table-column prop="value" :label="$t('Redis.value2')" :show-overflow-tooltip="true" />
<el-table-column prop="expire" :label="$t('Redis.expiration')" width="200">
<template slot-scope="scope">
<el-tag>
<span v-if="scope.row.expire === -1">
{{ $t('Redis.no_expired') }}
</span>
<span v-else-if="scope.row.expire === -2">
{{ $t('Redis.expired') }}
</span>
<span v-else>
{{ scope.row.expire }}{{ $t('Redis.unit') }}
</span>
</el-tag>
</template>
</el-table-column>
<el-table-column :label="$t('common.Operate')" width="150px" align="center">
<template slot-scope="scope">
<el-button type="danger" size="mini" @click="clearRedisData(scope.row)">{{ $t('Redis.clear') }}</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
</el-row>
<div style="height:1000px">
<iframe
src="/screen/index.html"
width="100%"
height="100%"
frameBorder="0"
allowFullScreen
/>
</div>
</template>
<script>
import { getCache, getKeyDefineList, getKeyValueList, batch } from '@/views/system/redis/redis'
import echarts from 'echarts'
import i18n from '@/i18n'
import ECharts from 'vue-echarts'
import 'echarts/lib/chart/line'
import 'echarts/lib/component/polar'
export default {
name: 'Redis',
name: 'ServerMonitor',
components: {
'v-chart': ECharts
},
data() {
return {
// 统计命令信息
commandstats: null,
// 使用内存
usedmemory: null,
// cache 信息
cache: [],
// key 列表
keyDefineListLoad: true,
keyDefineList: [],
// 模块弹出框
open: false,
keyTemplate: '',
cacheKeys: [],
cacheForm: {},
keyAndValues: [],
multipleSelection: [], // 多选数据
delBtlStatu: true
show: false,
monitor: null,
url: 'api/monitor',
data: {},
cpuInfo: {
tooltip: {
trigger: 'axis'
},
xAxis: {
type: 'category',
boundaryGap: false,
data: []
},
yAxis: {
type: 'value',
min: 0,
max: 100,
interval: 20
},
series: [{
data: [],
type: 'line',
areaStyle: {
normal: {
color: 'rgb(32, 160, 255)' // 改变区域颜色
}
},
itemStyle: {
normal: {
color: '#6fbae1',
lineStyle: {
color: '#6fbae1' // 改变折线颜色
}
}
}
}]
},
memoryInfo: {
tooltip: {
trigger: 'axis'
},
xAxis: {
type: 'category',
boundaryGap: false,
data: []
},
yAxis: {
type: 'value',
min: 0,
max: 100,
interval: 20
},
series: [{
data: [],
type: 'line',
areaStyle: {
normal: {
color: 'rgb(32, 160, 255)' // 改变区域颜色
}
},
itemStyle: {
normal: {
color: '#6fbae1',
lineStyle: {
color: '#6fbae1' // 改变折线颜色
}
}
}
}]
}
}
},
created() {
this.getList()
this.init()
this.monitor = window.setInterval(() => {
setTimeout(() => {
this.init()
}, 2)
}, 3500)
},
destroyed() {
clearInterval(this.monitor)
},
methods: {
// 获取redis的信息
getList() {
getCache().then(res => {
// console.log(res)
this.cache = res.info
// this.$model.closeLoading()
this.commandstats = echarts.init(this.$refs.commandstats, 'macarons')
const commandStats = [] // 指令状态数据
res.info.commandStats.forEach(row => {
commandStats.push({
name: row.command,
value: row.calls
})
})
this.commandstats.setOption({
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)'
},
series: [
{
name: i18n.t('Redis.command'),
type: 'pie',
roseType: 'radius',
radius: [15, 95],
center: ['50%', '38%'],
data: commandStats,
animationEasing: 'cubicInOut',
animationDuration: 1000
}
]
})
// 使用内存信息
this.usedmemory = echarts.init(this.$refs.usedmemory, 'macarons')
this.usedmemory.setOption({
tooltip: {
formatter: '{b} <br/>{a} : ' + this.cache.info.used_memory_human
},
series: [
{
name: i18n.t('Redis.pake'),
type: 'gauge',
min: 0,
max: 1000,
detail: {
formatter: this.cache.info.used_memory_human
},
data: [
{
value: parseFloat(this.cache.info.used_memory_human),
name: i18n.t('Redis.memory_consumption')
}
]
}
]
})
})
// 查询 Redis Key 模板列表
getKeyDefineList().then(res => {
this.keyDefineList = res.info
this.keyDefineListLoad = false
})
getKeyValueList().then(res => {
console.log('keyAndValue', res)
this.keyAndValues = res
})
},
clearRedisData(row) {
this.$confirm(i18n.t('Redis.msg1'), i18n.t('common.Tips'), {
confirmButtonText: i18n.t('common.Confirm'),
cancelButtonText: i18n.t('common.Cancel'),
type: 'warning'
}).then(() => {
const ids = []
ids.push(row.key)
batch(ids).then(res => {
this.$message({
type: 'success',
message: i18n.t('common.Operation_success')
})
location.reload()
})
}).catch(() => {
this.$message({
type: 'info',
message: i18n.t('Redis.msg2')
})
})
},
handleSelectionChange(val) {
this.multipleSelection = val
this.delBtlStatu = val.length == 0
},
batchDel() {
this.$confirm(i18n.t('common.Tip1', { count: this.multipleSelection.length }), i18n.t('common.Tips'), {
confirmButtonText: i18n.t('common.Confirm'),
cancelButtonText: i18n.t('common.Cancel'),
type: 'warning'
}).then(() => {
const ids = []
for (const i in this.multipleSelection) {
ids.push(this.multipleSelection[i].key)
}
batch(ids).then(res => {
this.$message({
type: 'success',
message: i18n.t('common.Operation_success')
})
location.reload()
})
}).catch(() => {
this.$message({
type: 'info',
message: i18n.t('Redis.msg2')
})
})
}
// init() {
// initData(this.url, {}).then(data => {
// this.data = data
// this.show = true
// if (this.cpuInfo.xAxis.data.length >= 8) {
// this.cpuInfo.xAxis.data.shift()
// this.memoryInfo.xAxis.data.shift()
// this.cpuInfo.series[0].data.shift()
// this.memoryInfo.series[0].data.shift()
// }
// this.cpuInfo.xAxis.data.push(data.time)
// this.memoryInfo.xAxis.data.push(data.time)
// this.cpuInfo.series[0].data.push(parseFloat(data.cpu.used))
// this.memoryInfo.series[0].data.push(parseFloat(data.memory.usageRate))
// })
// }
}
}
</script>
<style scoped lang="scss">
.card-box {
padding-right: 15px;
padding-left: 15px;
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .box-card {
margin-bottom: 5px;
span {
margin-right: 28px;
}
.el-icon-refresh {
margin-right: 10px;
float: right;
cursor: pointer;
}
}
.cpu, .memory, .swap, .disk {
width: 20%;
float: left;
padding-bottom: 20px;
margin-right: 5%;
}
.title {
text-align: center;
font-size: 15px;
font-weight: 500;
color: #999;
margin-bottom: 16px;
}
.footer {
text-align: center;
font-size: 15px;
font-weight: 500;
color: #999;
margin-top: -5px;
margin-bottom: 10px;
}
.content {
text-align: center;
margin-top: 5px;
margin-bottom: 5px;
}
</style>

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog
title="物料选择"
:title="$t('common.Please_select')"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
@@ -15,12 +15,12 @@
label-width="80px"
label-suffix=":"
>
<el-form-item label="物料名称">
<el-form-item :label="$t('md_me_materialbase.material_name')">
<el-input
v-model="query.search"
clearable
size="mini"
placeholder="物料名称"
:placeholder="$t('md_me_materialbase.material_name')"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
@@ -42,25 +42,25 @@
@current-change="clickChange"
>
<el-table-column v-if="!isSingle" type="selection" width="55" />
<el-table-column v-if="isSingle" label="选择" width="55">
<el-table-column v-if="isSingle" :label="$t('common.Please_select')" width="55">
<template slot-scope="scope">
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
</template>
</el-table-column>
<el-table-column prop="material_code" label="物料编码" width="140" />
<el-table-column prop="material_name" label="物料名称" width="170" show-overflow-tooltip />
<el-table-column prop="material_spec" label="物料规格" width="170" show-overflow-tooltip/>
<el-table-column prop="class_name" label="物料分类" width="140" />
<el-table-column prop="unit_name" label="计量单位" />
<el-table-column prop="product_series_name" label="系列" />
<el-table-column prop="update_optname" label="修改人" />
<el-table-column prop="update_time" label="修改时间" width="135" />
<el-table-column prop="material_code" :label="$t('md_me_materialbase.material_code')" width="140" />
<el-table-column prop="material_name" :label="$t('md_me_materialbase.material_name')" width="170" show-overflow-tooltip />
<el-table-column prop="material_spec" :label="$t('md_me_materialbase.material_spec')" width="170" show-overflow-tooltip />
<el-table-column prop="class_name" :label="$t('md_pb_classstandard.class_name')" width="140" />
<el-table-column prop="unit_name" :label="$t('md_pb_measureunit.unit_name')" />
<el-table-column prop="product_series_name" :label="$t('md_me_materialbase.product_series_name')" />
<el-table-column prop="update_optname" :label="$t('common.update_optname')" />
<el-table-column prop="update_time" :label="$t('common.update_time')" width="135" />
</el-table>
<!--分页组件-->
<pagination />
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
<el-button @click="dialogVisible = false">{{ $t('common.Cancel') }}</el-button>
<el-button type="primary" @click="submit">{{ $t('common.Confirm') }}</el-button>
</span>
</el-dialog>
</template>
@@ -71,13 +71,14 @@ import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import i18n from '@/i18n'
export default {
name: 'MaterialDialog',
components: { rrOperation, pagination },
dicts: ['is_used'],
cruds() {
return CRUD({ title: '物料选择', url: 'api/Materia', optShow: {}})
return CRUD({ title: i18n.t('common.Please_select'), url: 'api/Materia', optShow: {}})
},
mixins: [presenter(), header()],
props: {
@@ -135,7 +136,7 @@ export default {
}
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选物料')
this.$message(i18n.t('common.Please_select'))
return
}
this.crud.resetQuery(false)

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog
title="导入Excel文件"
:title="$t('common.import')"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
@@ -25,14 +25,14 @@
>
<i class="el-icon-upload" />
<div class="el-upload__text">
将文件拖到此处
<em>点击上传</em>
{{ $t('upload.load_text1') }}
<em>{{ $t('upload.load_text2') }}</em>
</div>
<div slot="tip" class="el-upload__tip">只能上传Excel文件且不超过10MB</div>
<div slot="tip" class="el-upload__tip">{{ $t('upload.load_text3') }}</div>
</el-upload>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
<el-button @click="dialogVisible = false">{{ $t('common.Cancel') }}</el-button>
<el-button type="primary" @click="submit">{{ $t('common.Confirm') }}</el-button>
</span>
</el-dialog>
</template>
@@ -42,6 +42,7 @@ import crudMaterial from './material'
import CRUD, { crud } from '@crud/crud'
import { download2 } from '@/api/data'
import { downloadFile } from '@/utils'
import i18n from '@/i18n'
export default {
name: 'UploadDialog',
@@ -82,7 +83,7 @@ export default {
this.$emit('update:dialogShow', false)
},
is_one() {
this.crud.notify('只能上传一个excel文件', CRUD.NOTIFICATION_TYPE.WARNING)
this.crud.notify(i18n.t('upload.load_text5'), CRUD.NOTIFICATION_TYPE.WARNING)
},
// 文件校验方法
beforeAvatarUpload(file) {
@@ -104,19 +105,18 @@ export default {
formdata.append('file', this.file1.raw)
// excelImport请求接口 formdata传递参数
crudMaterial.excelImport(formdata).then((res) => {
this.crud.notify('导入成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.notify(i18n.t('common.Success'), CRUD.NOTIFICATION_TYPE.SUCCESS)
this.$emit('tableChanged3', '')
this.$emit('update:dialogShow', false)
}).catch(err => {
const list = err.response.data.message
download2('/api/produceWorkorder/download', list).then(result => {
downloadFile(result, '错误信息汇总', 'xlsx')
downloadFile(result, i18n.t('gateway.check_error_log'), 'xlsx')
crud.downloadLoading = false
})
})
} else {
this.crud.notify('文件过大请上传小于10MB的文件〜', CRUD.NOTIFICATION_TYPE.WARNING)
this.crud.notify(i18n.t('upload.load_text4'), CRUD.NOTIFICATION_TYPE.WARNING)
}
}
}

View File

@@ -4,13 +4,13 @@
<div class="head-container">
<el-row>
<el-col :span="8">
模糊查询
{{ $t('common.Query') }}:
<el-input
v-model="query.search"
clearable
style="width: 200px"
size="mini"
placeholder="输入物料编码或名称"
:placeholder="$t('common.inputCodeOrName')"
prefix-icon="el-icon-search"
class="filter-item"
/>
@@ -29,7 +29,7 @@
size="mini"
@click="uploadShow = true"
>
导入
{{ $t('common.import') }}
</el-button>
</crudOperation>
<!--表单组件-->
@@ -43,65 +43,63 @@
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px">
<el-row>
<el-col :span="8">
<el-form-item label="物料编码" prop="material_code" >
<el-form-item :label="$t('md_me_materialbase.material_code')" prop="material_code">
<el-input v-model="form.material_code" style="width: 200px;" :disabled="crud.status.edit > 0" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="物料名称" prop="material_name">
<el-form-item :label="$t('md_me_materialbase.material_name')" prop="material_name">
<el-input v-model="form.material_name" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="物料规格" prop="material_spec">
<label slot="label">物料规格</label>
<el-form-item :label="$t('md_me_materialbase.material_spec')" prop="material_spec">
<el-input v-model="form.material_spec" style="width: 200px;" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="物料型号" prop="material_model">
<label slot="label">物料型号</label>
<el-form-item :label="$t('md_me_materialbase.material_model')" prop="material_model">
<el-input v-model="form.material_model" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="物料分类" prop="material_type_id">
<el-form-item :label="$t('md_me_materialbase.material_model')" prop="material_type_id">
<treeselect
v-model="form.material_type_id"
:load-options="loadClass"
:options="classes"
style="width: 200px;"
placeholder="请选择"
:placeholder="$t('common.Please_select')"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="外部标识" prop="ext_id">
<el-form-item :label="$t('common.ext_id')" prop="ext_id">
<el-input v-model="form.ext_id" style="width: 200px;" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="是否启用" prop="is_used">
<el-radio v-model="form.is_used" label="0"></el-radio>
<el-radio v-model="form.is_used" label="1" >是</el-radio>
<el-form-item :label="$t('common.is_used')" prop="is_used">
<el-radio v-model="form.is_used" label="0">{{ $t('common.No') }}</el-radio>
<el-radio v-model="form.is_used" label="1">{{ $t('common.Yes') }}</el-radio>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" />
<el-form-item :label="$t('common.remark')" prop="remark">
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
<el-button type="text" @click="crud.cancelCU">{{ $t('common.Cancel') }}</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">{{ $t('common.Confirm') }}</el-button>
</div>
</el-dialog>
<!--表格渲染-->
@@ -113,12 +111,12 @@
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column prop="material_code" label="物料编码" width="160" />
<el-table-column prop="material_name" label="物料名称" width="180" show-overflow-tooltip />
<el-table-column prop="material_spec" label="物料规格" width="140" />
<el-table-column prop="material_model" label="物料型号" />
<el-table-column prop="class_name" label="物料分类" width="140" :formatter="bill_typeFormat" />
<el-table-column label="启用" align="center" prop="is_used">
<el-table-column prop="material_code" :label="$t('md_me_materialbase.material_code')" width="160" />
<el-table-column prop="material_name" :label="$t('md_me_materialbase.material_name')" width="180" show-overflow-tooltip />
<el-table-column prop="material_spec" :label="$t('md_me_materialbase.material_spec')" width="140" />
<el-table-column prop="material_model" :label="$t('md_me_materialbase.material_model')" />
<el-table-column prop="class_name" :label="$t('md_pb_classstandard.class_name')" width="140" :formatter="bill_typeFormat" />
<el-table-column :label="$t('common.is_used')" align="center" prop="is_used">
<template slot-scope="scope">
<el-switch
v-model="scope.row.is_used"
@@ -130,9 +128,9 @@
/>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" width="140" />
<el-table-column prop="update_optname" label="修改人" />
<el-table-column prop="update_time" label="修改时间" width="135" />
<el-table-column prop="remark" :label="$t('common.remark')" width="140" />
<el-table-column prop="update_optname" :label="$t('common.update_optname')" />
<el-table-column prop="update_time" :label="$t('common.update_time')" width="135" />
<el-table-column
v-permission="['admin','Materialbase:edit','Materialbase:del']"
fixed="right"
@@ -151,7 +149,7 @@
<!--分页组件-->
<pagination />
</div>
<UploadDialog :dialog-show.sync="uploadShow"/>
<UploadDialog :dialog-show.sync="uploadShow" />
</div>
</template>
@@ -167,6 +165,7 @@ import crudClassstandard from '@/views/wms/basedata/class/classstandard'
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import crudMaterialbase from '@/views/wms/basedata/material/material'
import i18n from '@/i18n'
const defaultForm = {
material_id: null,

View File

@@ -11,12 +11,12 @@
label-width="80px"
label-suffix=":"
>
<el-form-item label="载具类型">
<el-form-item :label="$t('md_pb_storagevehicleinfo.storagevehicle_type')">
<el-select
v-model="query.vehicle_type"
clearable
size="mini"
placeholder="请选择"
:placeholder="$t('common.Please_select')"
class="filter-item"
style="width: 180px;"
@change="hand"
@@ -29,18 +29,17 @@
</el-select>
</el-form-item>
<el-form-item label="载具号">
<el-form-item :label="$t('md_pb_storagevehicleinfo.storagevehicle_code')">
<el-input
v-model="query.vehicle_code"
clearable
size="mini"
placeholder="载具号"
style="width: 110px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<rrOperation/>
<rrOperation />
</el-form>
</div>
@@ -67,30 +66,34 @@
>
<el-form ref="form" :model="materialForm" :rules="rules" size="mini" label-width="110px">
<el-form-item label="载具编码" prop="vehicle_code">
<el-input v-model="materialForm.vehicle_code" disabled style="width: 370px;"/>
<el-input v-model="materialForm.vehicle_code" disabled style="width: 370px;" />
</el-form-item>
<el-form-item label="物料编码" prop="material_code">
<template slot-scope="scope">
<el-input v-model="materialForm.material_code" clearable style="width: 370px"
@clear="materialForm.material_id='',materialForm.material_code='',materialForm.material_name='',materialForm.material_spec=''">
<el-button slot="append" icon="el-icon-plus" @click="queryMater"/>
<el-input
v-model="materialForm.material_code"
clearable
style="width: 370px"
@clear="materialForm.material_id='',materialForm.material_code='',materialForm.material_name='',materialForm.material_spec=''"
>
<el-button slot="append" icon="el-icon-plus" @click="queryMater" />
</el-input>
</template>
</el-form-item>
<el-form-item label="物料规格" prop="material_spec">
<el-input v-model="materialForm.material_spec" disabled style="width: 370px;"/>
<el-input v-model="materialForm.material_spec" disabled style="width: 370px;" />
</el-form-item>
<el-form-item label="批 次" prop="pcsn">
<el-input v-model="materialForm.pcsn" clearable style="width: 370px;"/>
<el-input v-model="materialForm.pcsn" clearable style="width: 370px;" />
</el-form-item>
<el-form-item label="物料数量" prop="qty">
<el-input v-model="materialForm.qty" clearable style="width: 370px;"/>
<el-input v-model="materialForm.qty" clearable style="width: 370px;" />
</el-form-item>
<el-form-item label="冻结数量" prop="frozen_qty">
<el-input v-model="materialForm.frozen_qty" clearable style="width: 370px;"/>
<el-input v-model="materialForm.frozen_qty" clearable style="width: 370px;" />
</el-form-item>
<el-form-item label="流程实例" prop="proc_inst_id">
<el-input v-model="materialForm.proc_inst_id" clearable style="width: 370px;"/>
<el-input v-model="materialForm.proc_inst_id" clearable style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@@ -108,11 +111,11 @@
<el-form ref="form" :model="updateForm" :rules="rules" size="mini" label-width="110px">
<el-form-item label="载具编号" prop="vehicle_code">
<template slot-scope="scope">
<el-input v-model="updateForm.vehicle_code" clearable/>
<el-input v-model="updateForm.vehicle_code" clearable />
</template>
</el-form-item>
<el-form-item label="载具重量(g)" prop="vehicle_weight">
<el-input-number v-model="updateForm.vehicle_weight" clearable style="width: 370px;"/>
<el-input-number v-model="updateForm.vehicle_weight" clearable style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@@ -129,22 +132,22 @@
>
<el-form ref="form" :model="printForm" size="mini" label-width="150px">
<el-form-item label="纸张高度(mm)" prop="pageh">
<el-input v-model="printForm.pageh" :precision="0" style="width: 150px;"/>
<el-input v-model="printForm.pageh" :precision="0" style="width: 150px;" />
</el-form-item>
<el-form-item label="纸张宽度(mm)" prop="pagew">
<el-input v-model="printForm.pagew" :precision="0" style="width: 150px;"/>
<el-input v-model="printForm.pagew" :precision="0" style="width: 150px;" />
</el-form-item>
<el-form-item label="页边距top(mm)" prop="pagetop">
<el-input v-model="printForm.pagetop" :precision="0" style="width: 150px;"/>
<el-input v-model="printForm.pagetop" :precision="0" style="width: 150px;" />
</el-form-item>
<el-form-item label="页边距right(mm)" prop="pageright">
<el-input v-model="printForm.pageright" :precision="0" style="width: 150px;"/>
<el-input v-model="printForm.pageright" :precision="0" style="width: 150px;" />
</el-form-item>
<el-form-item label="页边距down(mm)" prop="pagedown">
<el-input v-model="printForm.pagedown" :precision="0" style="width: 150px;"/>
<el-input v-model="printForm.pagedown" :precision="0" style="width: 150px;" />
</el-form-item>
<el-form-item label="页边距left(mm)" prop="pageleft">
<el-input v-model="printForm.pageleft" :precision="0" style="width: 150px;"/>
<el-input v-model="printForm.pageleft" :precision="0" style="width: 150px;" />
</el-form-item>
<br>
</el-form>
@@ -180,22 +183,22 @@
</el-form-item>
<br>
<el-form-item label="起始载具号" prop="vehicle_code">
<el-input v-model="form.vehicle_code" :disabled="true" style="width: 250px;"/>
<el-input v-model="form.vehicle_code" :disabled="true" style="width: 250px;" />
</el-form-item>
<el-form-item label="载具数量" prop="num">
<el-input-number v-model="form.num" :precision="0" style="width: 150px;"/>
<el-input-number v-model="form.num" :precision="0" style="width: 150px;" />
</el-form-item>
<el-form-item label="高度(mm)" prop="h">
<el-input-number v-model="form.h" :precision="0" style="width: 150px;"/>
<el-input-number v-model="form.h" :precision="0" style="width: 150px;" />
</el-form-item>
<el-form-item label="宽度(mm)" prop="w">
<el-input-number v-model="form.w" :precision="0" style="width: 150px;"/>
<el-input-number v-model="form.w" :precision="0" style="width: 150px;" />
</el-form-item>
<el-form-item label="深度(mm)" prop="l">
<el-input-number v-model="form.l" :precision="0" style="width: 150px;"/>
<el-input-number v-model="form.l" :precision="0" style="width: 150px;" />
</el-form-item>
<el-form-item label="重量(g)" prop="weight">
<el-input-number v-model="form.weight" :precision="0" style="width: 150px;"/>
<el-input-number v-model="form.weight" :precision="0" style="width: 150px;" />
</el-form-item>
<el-form-item label="是否启用">
<el-radio v-model="form.is_used" label="0">否</el-radio>
@@ -236,8 +239,8 @@
/>
</template>
</el-table-column>
<el-table-column prop="create_name" label="创建人"/>
<el-table-column prop="create_time" label="创建时间" width="150px"/>
<el-table-column prop="create_name" label="创建人" />
<el-table-column prop="create_time" label="创建时间" width="150px" />
<el-table-column
v-permission="['admin','storagevehicleinfo:edit','storagevehicleinfo:del']"
label="操作"
@@ -254,7 +257,7 @@
</el-table-column>
</el-table>
<!-- 分页组件-->
<pagination/>
<pagination />
</div>
<MaterDtl
:dialog-show.sync="materialShow"
@@ -275,7 +278,6 @@ import pagination from '@crud/Pagination'
import { getLodop } from '@/assets/js/lodop/LodopFuncs'
import MaterDtl from '@/views/wms/basedata/material/MaterialDialog'
const defaultForm = {
vehicle_code: null,
vehicle_name: null,
@@ -298,7 +300,7 @@ const defaultForm = {
}
export default {
name: 'Storagevehicleinfo',
dicts: ['storagevehicle_type', "VEHICLE_OVER_TYPE"],
dicts: ['storagevehicle_type', 'VEHICLE_OVER_TYPE'],
components: { pagination, crudOperation, rrOperation, udOperation, MaterDtl },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
@@ -347,23 +349,23 @@ export default {
permission: {},
rules: {
vehicle_code: [
{required: true, message: '不能为空', trigger: 'blur'}
{ required: true, message: '不能为空', trigger: 'blur' }
],
is_delete: [
{required: true, message: '不能为空', trigger: 'blur'}
{ required: true, message: '不能为空', trigger: 'blur' }
],
is_used: [
{required: true, message: '不能为空', trigger: 'blur'}
{ required: true, message: '不能为空', trigger: 'blur' }
],
vehicle_type: [
{required: true, message: '不能为空', trigger: 'blur'}
{ required: true, message: '不能为空', trigger: 'blur' }
],
overstruct_type: [
{required: true, message: '不能为空', trigger: 'blur'}
{ required: true, message: '不能为空', trigger: 'blur' }
],
num: [
{required: true, message: '不能为空', trigger: 'blur'},
{validator: numberOne}
{ required: true, message: '不能为空', trigger: 'blur' },
{ validator: numberOne }
]
}
}