fix: 驼峰转换下划线、lucene
This commit is contained in:
@@ -1,454 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<!--工具栏-->
|
||||
<el-form :inline="true" class="demo-form-inline" label-suffix=":" label-width="80px">
|
||||
<el-form-item label="日志标签">
|
||||
<el-cascader
|
||||
v-model="labelAndValue"
|
||||
:options="labelsOptions"
|
||||
placeholder="请选择标签"
|
||||
@change="queryData"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字">
|
||||
<label slot="label">关 键 字:</label>
|
||||
|
||||
<el-input
|
||||
v-model="text"
|
||||
size="mini"
|
||||
placeholder="请输入内容"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="!showOptions" label="时间范围">
|
||||
<el-date-picker
|
||||
v-model="timeRange"
|
||||
size="mini"
|
||||
clearable
|
||||
type="datetimerange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
align="right"
|
||||
@change="queryData"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="showOptions" label="时间段">
|
||||
<el-select v-model="timeZoneValue" filterable placeholder="请选择标签" size="mini" @change="queryData">
|
||||
<el-option
|
||||
v-for="item in timeZoneOptions"
|
||||
:key="item.index"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-tooltip class="item" effect="dark" content="切换查询条件" placement="top">
|
||||
<span class="el-icon-sort" @click="changeShow" />
|
||||
</el-tooltip>
|
||||
</el-form-item>
|
||||
<el-form-item label="方向">
|
||||
<label slot="label">方 向:</label>
|
||||
<el-radio-group v-model="direction" size="mini" @change="queryData">
|
||||
<el-radio label="backward">backward</el-radio>
|
||||
<el-radio label="forward">forward</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="显示条数">
|
||||
<el-input-number
|
||||
v-model="limits"
|
||||
size="mini"
|
||||
controls-position="right"
|
||||
:min="100"
|
||||
:max="5000"
|
||||
:step="100"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="滚动步数">
|
||||
<el-input-number
|
||||
v-model="scrollStep"
|
||||
size="mini"
|
||||
controls-position="right"
|
||||
:min="10"
|
||||
:max="2000"
|
||||
:step="10"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-dropdown split-button type="primary" size="mini" @click="queryData">
|
||||
查询{{ runStatu }}
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item v-for="(item, index) in runStatuOptions" :key="index" @click.native="startInterval(item)">{{ item.label }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div style="margin: 3px; min-height: 80vh;">
|
||||
<!--数据判空-->
|
||||
<el-empty v-if="showEmpty" :description="emptyText" />
|
||||
<!--数据加载-->
|
||||
<el-card v-else shadow="hover" style="width: 100%" class="log-warpper">
|
||||
<div style="width: 100%">
|
||||
<div v-for="(log, index) in logs" :key="index">
|
||||
<div style="margin-bottom: 5px; font-size: 12px;" v-html="log[1]" />
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import logOperation from '@/views/loki/api/loki'
|
||||
import { default as AnsiUp } from 'ansi_up'
|
||||
|
||||
let queryParam = {
|
||||
logLabel: null,
|
||||
logLabelValue: null,
|
||||
start: null,
|
||||
end: null,
|
||||
text: null,
|
||||
limits: 100,
|
||||
direction: 'backward'
|
||||
}
|
||||
export default {
|
||||
name: 'Loki',
|
||||
data() {
|
||||
return {
|
||||
labelAndValue: [], // 搜索的值
|
||||
labelsOptions: [], // 所有标签和对应所有值数据
|
||||
timeRange: [],
|
||||
text: '',
|
||||
limits: 100,
|
||||
direction: 'backward',
|
||||
logData: [],
|
||||
logs: [], // 所有日志
|
||||
showEmpty: true,
|
||||
emptyText: '请选择标签',
|
||||
displayDirection: [{
|
||||
value: 'backward',
|
||||
label: '新的在前'
|
||||
}, {
|
||||
value: 'forward',
|
||||
label: '旧的在前'
|
||||
}],
|
||||
scrollStep: 10,
|
||||
runStatu: 'off',
|
||||
runStatuOptions: [{
|
||||
label: 'off',
|
||||
value: 0
|
||||
}, {
|
||||
label: '5s',
|
||||
value: 5000
|
||||
}, {
|
||||
label: '10s',
|
||||
value: 10000
|
||||
}, {
|
||||
label: '1m',
|
||||
value: 60000
|
||||
}, {
|
||||
label: '5m',
|
||||
value: 300000
|
||||
}, {
|
||||
label: '30m',
|
||||
value: 1800000
|
||||
}],
|
||||
timeZoneOptions: [{
|
||||
label: '最近5分钟',
|
||||
value: 300 * 1000
|
||||
}, {
|
||||
label: '最近15分钟',
|
||||
value: 900 * 1000
|
||||
}, {
|
||||
label: '最近30分钟',
|
||||
value: 1800 * 1000
|
||||
}, {
|
||||
label: '最近1小时',
|
||||
value: 3600 * 1000
|
||||
}, {
|
||||
label: '最近3小时',
|
||||
value: 3600 * 1000 * 3
|
||||
}, {
|
||||
label: '最近6小时',
|
||||
value: 3600 * 1000 * 6
|
||||
}, {
|
||||
label: '最近12小时',
|
||||
value: 3600 * 1000 * 12
|
||||
}, {
|
||||
label: '最近24小时',
|
||||
value: 3600 * 1000 * 24
|
||||
}, {
|
||||
label: '最近2天',
|
||||
value: 3600 * 1000 * 24 * 2
|
||||
}, {
|
||||
label: '最近7天',
|
||||
value: 3600 * 1000 * 24 * 7
|
||||
}, {
|
||||
label: '最近15天',
|
||||
value: 3600 * 1000 * 24 * 15
|
||||
}],
|
||||
timeZoneValue: '',
|
||||
showOptions: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('scroll', this.handleScroll)
|
||||
},
|
||||
created() {
|
||||
this.initLabelsValues()
|
||||
},
|
||||
// 关闭定时器 - 加了缓存就必须使用deactivated
|
||||
deactivated() {
|
||||
// js提供的clearInterval方法用来清除定时器
|
||||
console.log('定时任务销毁')
|
||||
clearInterval(this.timer)
|
||||
window.removeEventListener('scroll', this.handleScroll)
|
||||
},
|
||||
beforeDestroy() {
|
||||
// js提供的clearInterval方法用来清除定时器
|
||||
console.log('定时任务销毁')
|
||||
clearInterval(this.timer)
|
||||
window.removeEventListener('scroll', this.handleScroll)
|
||||
},
|
||||
methods: {
|
||||
initLabelsValues() {
|
||||
logOperation.labelsValues().then(res => {
|
||||
this.labelsOptions = res
|
||||
})
|
||||
},
|
||||
queryData() {
|
||||
console.log(this.labelAndValue)
|
||||
// 清空查询数据
|
||||
this.clearParam()
|
||||
if (this.labelAndValue.length > 0) {
|
||||
queryParam.logLabel = this.labelAndValue[0]
|
||||
queryParam.logLabelValue = this.labelAndValue[1]
|
||||
}
|
||||
if (queryParam.logLabelValue === null) { // 判空
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '请选择标签',
|
||||
type: 'warning'
|
||||
})
|
||||
this.showEmpty = true
|
||||
this.emptyText = '请选择标签'
|
||||
return
|
||||
}
|
||||
if (this.timeRange.length !== 0) { // 如果是输入时间范围
|
||||
queryParam.start = (new Date(this.timeRange[0]).getTime() * 1000000).toString()
|
||||
queryParam.end = (new Date(this.timeRange[1]).getTime() * 1000000).toString()
|
||||
}
|
||||
if (this.timeZoneValue) {
|
||||
const time = new Date()
|
||||
queryParam.start = ((time.getTime() - this.timeZoneValue) * 1000000).toString()
|
||||
queryParam.end = (time.getTime() * 1000000).toString()
|
||||
}
|
||||
if (this.text) {
|
||||
queryParam.text = this.text.replace(/^\s*|\s*$/g, '')
|
||||
}
|
||||
if (this.limits) {
|
||||
queryParam.limits = this.limits
|
||||
}
|
||||
queryParam.direction = this.direction
|
||||
var ansi_up = new AnsiUp()
|
||||
logOperation.getLogData(queryParam).then(res => {
|
||||
this.showEmpty = false
|
||||
if (res.data.result.length === 1) {
|
||||
this.logs = res.data.result[0].values
|
||||
for (const i in res.data.result[0].values) {
|
||||
this.logs[i][1] = ansi_up.ansi_to_html(res.data.result[0].values[i][1])
|
||||
}
|
||||
} else if (res.data.result.length > 1) {
|
||||
// 清空
|
||||
this.logs = []
|
||||
for (const j in res.data.result) { // 用push的方式将所有日志数组添加进去
|
||||
for (const values_index in res.data.result[j].values) {
|
||||
this.logs.push(res.data.result[j].values[values_index])
|
||||
}
|
||||
}
|
||||
for (const k in this.logs) {
|
||||
this.logs[k][1] = ansi_up.ansi_to_html(this.logs[k][1])
|
||||
}
|
||||
if (this.direction === 'backward') { // 由于使用公共标签会导致时间顺序错乱,因此对二维数组进行排序
|
||||
this.logs.sort((a, b) => b[0] - a[0])
|
||||
} else {
|
||||
this.logs.sort((a, b) => a[0] - b[0])
|
||||
}
|
||||
} else {
|
||||
this.showEmpty = true
|
||||
this.emptyText = '暂无日志信息,请选择时间段试试'
|
||||
}
|
||||
})
|
||||
},
|
||||
clearParam() {
|
||||
queryParam = {
|
||||
logLabel: null,
|
||||
logLabelValue: null,
|
||||
start: null,
|
||||
end: null,
|
||||
text: null,
|
||||
limits: 100,
|
||||
direction: 'backward'
|
||||
}
|
||||
},
|
||||
handleScroll() { // 滚动事件
|
||||
const scrollTop = document.documentElement.scrollTop// 滚动高度
|
||||
const clientHeight = document.documentElement.clientHeight// 可视高度
|
||||
const scrollHeight = document.documentElement.scrollHeight// 内容高度
|
||||
const bottomest = Math.ceil(scrollTop + clientHeight)
|
||||
if (bottomest >= scrollHeight) {
|
||||
// 加载新数据
|
||||
queryParam.limits = this.scrollStep
|
||||
queryParam.direction = this.direction
|
||||
// 获取时间差
|
||||
let zone = queryParam.end - queryParam.start
|
||||
if (this.timeRange.length) { // 如果是输入时间范围
|
||||
zone = ((new Date(this.timeRange[1]).getTime() - new Date(this.timeRange[0]).getTime()) * 1000000).toString()
|
||||
}
|
||||
if (this.timeZoneValue) {
|
||||
zone = this.timeZoneValue * 1000000
|
||||
}
|
||||
if (zone === 0) {
|
||||
zone = 3600 * 1000 * 6
|
||||
}
|
||||
if (this.direction === 'backward') { // 设置时间区间
|
||||
queryParam.start = (this.logs[this.logs.length - 1][0] - zone).toString()
|
||||
queryParam.end = this.logs[this.logs.length - 1][0]
|
||||
} else {
|
||||
queryParam.start = this.logs[this.logs.length - 1][0]
|
||||
queryParam.end = (parseFloat(this.logs[this.logs.length - 1][0]) + parseFloat(zone.toString())).toString()
|
||||
}
|
||||
var ansi_up = new AnsiUp()
|
||||
logOperation.getLogData(queryParam).then(res => {
|
||||
console.log(res)
|
||||
this.showEmpty = false
|
||||
if (res.data.result.length === 1) {
|
||||
// 如果返回的日志是一样的就不显示
|
||||
if (res.data.result[0].values.length === 1 && ansi_up.ansi_to_html(res.data.result[0].values[0][1]) === this.logs[this.logs.length - 1][1]) {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
duration: 1000,
|
||||
message: '当前时间段日志已最新!',
|
||||
type: 'warning'
|
||||
})
|
||||
return
|
||||
}
|
||||
const log = res.data.result[0].values
|
||||
for (const i in res.data.result[0].values) {
|
||||
log[i][1] = ansi_up.ansi_to_html(res.data.result[0].values[i][1])
|
||||
this.logs.push(log[i])
|
||||
}
|
||||
} else if (res.data.result.length > 1) {
|
||||
const tempArray = [] // 数据需要处理,由于是追加数组,所以需要用额外变量来存放
|
||||
// 刷新就是添加,不清空原数组
|
||||
for (const j in res.data.result) { // 用push的方式将所有日志数组添加进去
|
||||
for (const values_index in res.data.result[j].values) {
|
||||
tempArray.push(res.data.result[j].values[values_index])
|
||||
}
|
||||
}
|
||||
if (this.direction === 'backward') { // 由于使用公共标签会导致时间顺序错乱,因此对二维数组进行排序
|
||||
tempArray.sort((a, b) => b[0] - a[0])
|
||||
} else {
|
||||
tempArray.sort((a, b) => a[0] - b[0])
|
||||
}
|
||||
for (const k in tempArray) {
|
||||
tempArray[k][1] = ansi_up.ansi_to_html(tempArray[k][1]) // 数据转换
|
||||
this.logs.push(tempArray[k]) // 追加数据
|
||||
}
|
||||
} else {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
duration: 1000,
|
||||
message: '暂无以往日志数据!',
|
||||
type: 'warning'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
startInterval(item) {
|
||||
this.runStatu = item.label
|
||||
console.log(item.value)
|
||||
if (item.value !== 0) {
|
||||
this.timer = setInterval(() => { // 定时刷新
|
||||
this.intervalLogs()
|
||||
}, item.value)
|
||||
} else {
|
||||
console.log('销毁了')
|
||||
clearInterval(this.timer)
|
||||
}
|
||||
},
|
||||
intervalLogs() { // 定时器的方法
|
||||
// 组织参数
|
||||
// 设置开始时间和结束时间
|
||||
// 开始为现在时间
|
||||
const start = new Date()
|
||||
const end = new Date()
|
||||
// 时差判断
|
||||
let zone = queryParam.end - queryParam.start
|
||||
if (this.timeRange.length) { // 如果是输入时间范围
|
||||
zone = ((new Date(this.timeRange[1]).getTime() - new Date(this.timeRange[0]).getTime()) * 1000000).toString()
|
||||
}
|
||||
if (this.timeZoneValue) {
|
||||
zone = this.timeZoneValue * 1000000
|
||||
}
|
||||
if (zone === 0) { // 防止空指针
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 6)
|
||||
queryParam.start = (start.getTime() * 1000000).toString()
|
||||
} else {
|
||||
queryParam.start = (start.getTime() * 1000000 - zone).toString()
|
||||
}
|
||||
queryParam.end = (end.getTime() * 1000000).toString()
|
||||
queryParam.limits = this.limits
|
||||
console.log('定时器最后参数:', queryParam)
|
||||
var ansi_up = new AnsiUp() // 后端日志格式转化
|
||||
logOperation.getLogData(queryParam).then(res => {
|
||||
console.log('res', res)
|
||||
this.showEmpty = false
|
||||
if (res.data.result.length === 1) {
|
||||
this.logs = res.data.result[0].values
|
||||
for (const i in res.data.result[0].values) { // 格式转换
|
||||
this.logs[i][1] = ansi_up.ansi_to_html(res.data.result[0].values[i][1])
|
||||
}
|
||||
} else if (res.data.result.length > 1) {
|
||||
// 清空
|
||||
this.logs = []
|
||||
for (const j in res.data.result) { // 用push的方式将所有日志数组添加进去
|
||||
for (const values_index in res.data.result[j].values) {
|
||||
this.logs.push(res.data.result[j].values[values_index])
|
||||
}
|
||||
}
|
||||
for (const k in this.logs) {
|
||||
this.logs[k][1] = ansi_up.ansi_to_html(this.logs[k][1])
|
||||
}
|
||||
if (this.direction === 'backward') { // 由于使用公共标签会导致时间顺序错乱,因此对二维数组进行排序
|
||||
this.logs.sort((a, b) => b[0] - a[0])
|
||||
} else {
|
||||
this.logs.sort((a, b) => a[0] - b[0])
|
||||
}
|
||||
} else {
|
||||
this.showEmpty = true
|
||||
this.emptyText = '暂无日志信息,请选择时间段试试'
|
||||
}
|
||||
})
|
||||
},
|
||||
changeShow() {
|
||||
// 清空数据
|
||||
this.timeZoneValue = ''
|
||||
this.timeRange = []
|
||||
this.showOptions = !this.showOptions
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.log-warpper {
|
||||
word-break: break-word;
|
||||
word-wrap: break-word
|
||||
}
|
||||
</style>
|
||||
10
nladmin-ui/src/views/lucene/api/log.js
Normal file
10
nladmin-ui/src/views/lucene/api/log.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function delAll(id) {
|
||||
return request({
|
||||
url: 'api/lucene/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export default { delAll }
|
||||
@@ -2,8 +2,8 @@ import request from '@/utils/request'
|
||||
|
||||
export function getLogData(param) {
|
||||
return request({
|
||||
url: 'api/loki/logs',
|
||||
method: 'post',
|
||||
url: 'api/lucene/getAll',
|
||||
method: 'get',
|
||||
data: param
|
||||
})
|
||||
}
|
||||
108
nladmin-ui/src/views/lucene/index.vue
Normal file
108
nladmin-ui/src/views/lucene/index.vue
Normal file
@@ -0,0 +1,108 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<Search />
|
||||
<crudOperation />
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<!-- <el-table-column type="selection" width="55"/>-->
|
||||
<!-- <el-table-column v-if="false" prop="id" label="id"/>-->
|
||||
<el-table-column prop="operate" width="50" label="操作" />
|
||||
<el-table-column prop="device_code" label="设备号" />
|
||||
<el-table-column prop="task_code" label="任务编号" />
|
||||
<el-table-column prop="instruct_code" label="指令编号" />
|
||||
<el-table-column prop="method" label="方法" />
|
||||
<el-table-column prop="status_code" label="状态码" />
|
||||
<el-table-column prop="requestparam" label="请求参数" />
|
||||
<el-table-column prop="responseparam" label="返回参数" />
|
||||
<el-table-column prop="logTime" width="170" label="记录时间" />
|
||||
<el-table-column prop="content" width="500" label="内容详情" />
|
||||
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Search from './search.vue'
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
export default {
|
||||
name: 'LuceneLog',
|
||||
components: { Search, pagination, crudOperation },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds: function() {
|
||||
return CRUD({
|
||||
title: '系统参数', url: 'api/lucene/getAll', idField: 'id', sort: 'id,desc',
|
||||
queryOnPresenterCreated: true,
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false
|
||||
},
|
||||
page: {
|
||||
size: 40,
|
||||
total: 0,
|
||||
page: 0
|
||||
},
|
||||
query: {
|
||||
createTime: [new Date(new Date().setTime(new Date().getTime() - 3600 * 1000 * 24)), new Date()]
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
query: { blurry: '123' },
|
||||
permission: {
|
||||
add: ['admin', 'param:add'],
|
||||
edit: ['admin', 'param:edit'],
|
||||
del: ['admin', 'param:del']
|
||||
},
|
||||
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
confirmDelAll() {
|
||||
this.$confirm(`确认清空所有操作日志吗?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.crud.delAllLoading = true
|
||||
delAll('device_execute').then(res => {
|
||||
this.crud.delAllLoading = false
|
||||
this.crud.dleChangePage(1)
|
||||
this.crud.delSuccessNotify()
|
||||
this.crud.toQuery()
|
||||
}).catch(err => {
|
||||
this.crud.delAllLoading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
113
nladmin-ui/src/views/lucene/search.vue
Normal file
113
nladmin-ui/src/views/lucene/search.vue
Normal file
@@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-input
|
||||
v-model="query.device_code"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入你要搜索的设备号"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
<el-input
|
||||
v-model="query.method"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入你要搜索的方法名"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
<el-input
|
||||
v-model="query.status_code"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入你要搜索的状态码"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
<el-input
|
||||
v-model="query.requestparam"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入你要搜索的请求参数"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
<el-input
|
||||
v-model="query.responseparam"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入你要搜索的返回参数"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
<el-input
|
||||
v-model="query.blurry"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入你要搜索的内容详情"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
<!--
|
||||
<date-range-picker v-model="query.createTime" class="date-item" />
|
||||
-->
|
||||
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="datetimerange"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
:picker-options="pickerOptions"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
align="right"
|
||||
/>
|
||||
<rrOperation />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { header } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
|
||||
export default {
|
||||
components: { rrOperation },
|
||||
mixins: [header()],
|
||||
|
||||
data() {
|
||||
return {
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
text: '最近一周',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}, {
|
||||
text: '最近一个月',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}, {
|
||||
text: '最近三个月',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}]
|
||||
},
|
||||
value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
|
||||
value2: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
63
nladmin-ui/src/views/lucene/time.vue
Normal file
63
nladmin-ui/src/views/lucene/time.vue
Normal file
@@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!--
|
||||
<date-range-picker v-model="query.createTime" class="date-item" />
|
||||
-->
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="datetimerange"
|
||||
:picker-options="pickerOptions"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
align="right"
|
||||
/>
|
||||
<rrOperation />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { header } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
|
||||
export default {
|
||||
components: { rrOperation },
|
||||
mixins: [header()],
|
||||
|
||||
data() {
|
||||
return {
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
text: '最近一周',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}, {
|
||||
text: '最近一个月',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}, {
|
||||
text: '最近三个月',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}]
|
||||
},
|
||||
value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
|
||||
value2: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -92,7 +92,7 @@
|
||||
v-loading="crud.loading"
|
||||
lazy
|
||||
:load="getDeptDatas"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
:tree-props="{children: 'children', hasChildren: 'has_children'}"
|
||||
:data="crud.data"
|
||||
row-key="dept_id"
|
||||
@select="crud.selectChange"
|
||||
@@ -220,7 +220,7 @@ export default {
|
||||
if (data.children) {
|
||||
this.buildDepts(data.children)
|
||||
}
|
||||
if (data.hasChildren && !data.children) {
|
||||
if (data.has_children && !data.children) {
|
||||
data.children = null
|
||||
}
|
||||
})
|
||||
@@ -228,7 +228,7 @@ export default {
|
||||
getDepts() {
|
||||
crudDept.getDeptvo({ is_used: true }).then(res => {
|
||||
this.depts = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
if (obj.has_children) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
:load="getMenus"
|
||||
:auto-load-root-options="false"
|
||||
:data="crud.data"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
:tree-props="{children: 'children', hasChildren: 'has_children'}"
|
||||
row-key="menu_id"
|
||||
|
||||
@select="crud.selectChange"
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
check-strictly
|
||||
accordion
|
||||
show-checkbox
|
||||
node-key="menuId"
|
||||
node-key="menu_id"
|
||||
@check="menuChange"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<el-col :span="4">
|
||||
<div class="head-container">
|
||||
<el-input
|
||||
v-model="dept_name"
|
||||
v-model="deptName"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入部门名称"
|
||||
@@ -216,7 +216,7 @@
|
||||
:data="deptsDatas"
|
||||
:default-checked-keys="depChecked"
|
||||
:props="deptProps"
|
||||
node-key="deptId"
|
||||
node-key="dept_id"
|
||||
highlight-current
|
||||
check-strictly
|
||||
@check="handCheck"
|
||||
@@ -251,7 +251,7 @@
|
||||
<el-form-item label="用户名" prop="username">
|
||||
<el-input v-model="dataDialog.username" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="presonName">
|
||||
<el-form-item label="姓名" prop="person_name">
|
||||
<el-input v-model="dataDialog.person_name" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<el-table
|
||||
@@ -265,15 +265,15 @@
|
||||
<el-table-column label="数据权限">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.permissionId"
|
||||
v-model="scope.row.permission_id"
|
||||
placeholder="请选择"
|
||||
@change="openRelevance(scope.row, scope.$index)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in permissions"
|
||||
:key="item.permissionId"
|
||||
:key="item.permission_id"
|
||||
:label="item.name"
|
||||
:value="item.permissionId"
|
||||
:value="item.permission_id"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
@@ -395,7 +395,7 @@ export default {
|
||||
dataPerm: false,
|
||||
dataDialog: {},
|
||||
permissions: [],
|
||||
permissionId: '',
|
||||
permission_id: '',
|
||||
multipleSelection: [], // 选中
|
||||
relevanceUser: false, // 关联用户
|
||||
rowData: {}, // 当行数据
|
||||
@@ -465,7 +465,7 @@ export default {
|
||||
this.getSupDepts(form.dept_id)
|
||||
}
|
||||
// this.getRoleLevel() 暂时不用
|
||||
form.is_used = form.enabled.toString()
|
||||
// form.is_used = form.enabled.toString()
|
||||
},
|
||||
// 新增前将多选的值设置为空
|
||||
[CRUD.HOOK.beforeToAdd]() {
|
||||
@@ -534,11 +534,8 @@ export default {
|
||||
}, 100)
|
||||
},
|
||||
getDepts() {
|
||||
console.log('获取部门')
|
||||
crudDept.getDepts({ is_used: true }).then(res => {
|
||||
console.log('获取的部门信息', res)
|
||||
this.depts = res.content.map(function(obj) {
|
||||
console.log('---', obj)
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
@@ -548,7 +545,6 @@ export default {
|
||||
},
|
||||
getSupDepts(deptId) {
|
||||
crudDept.getDeptSuperior(deptId).then(res => {
|
||||
console.log('父部门', res)
|
||||
const date = res.content
|
||||
this.buildDepts(date)
|
||||
this.depts = date
|
||||
@@ -580,7 +576,7 @@ export default {
|
||||
},
|
||||
normalizer(node) {
|
||||
return {
|
||||
id: node.deptId,
|
||||
id: node.dept_id,
|
||||
label: node.name,
|
||||
children: node.children
|
||||
}
|
||||
@@ -643,13 +639,13 @@ export default {
|
||||
crudDept.getDeptTree().then(res => {
|
||||
this.deptsDatas = res.content
|
||||
})
|
||||
this.openDrawer()
|
||||
this.openDrawer() // 打开抽屉
|
||||
this.drawerTitle = '分配部门权限'
|
||||
this.flag = true
|
||||
// 默认选中
|
||||
const deptIds = []
|
||||
for (var index in row.depts) {
|
||||
deptIds.push(row.depts[index].deptId)
|
||||
deptIds.push(row.depts[index].dept_id)
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs.deptUser.setCheckedKeys(deptIds)
|
||||
@@ -684,23 +680,25 @@ export default {
|
||||
this.multipleSelection = []
|
||||
// 获取权限范围
|
||||
crudDataPermission.getDataScopeType().then(res => {
|
||||
console.log('权限范围', res)
|
||||
this.dataDialog.dataScopeType = res
|
||||
// permissions
|
||||
crudDataPermission.getDataPermissionOption().then(res => {
|
||||
// console.log(res)
|
||||
console.log('数据权限', res)
|
||||
this.permissions = res
|
||||
this.dataDialog.person_name = row.person_name
|
||||
this.dataDialog.username = row.username
|
||||
this.dataDialog.userId = row.userId
|
||||
this.dataDialog.user_id = row.user_id
|
||||
this.dataPermissionTitle = '[' + row.person_name + '] 数据权限'
|
||||
this.dataPerm = true
|
||||
// 回显数据
|
||||
crudDataPermission.getDataShow(row.userId).then(res => {
|
||||
crudDataPermission.getDataShow(row.user_id).then(res => {
|
||||
console.log('要回显的数据', res)
|
||||
this.$nextTick(function() {
|
||||
for (var index = 0; index < res.length; index++) {
|
||||
for (var i = 0; i < this.dataDialog.dataScopeType.length; i++) {
|
||||
if (this.dataDialog.dataScopeType[i].value == res[index].permissionScopeType) {
|
||||
this.dataDialog.dataScopeType[i].permissionId = res[index].permissionId
|
||||
this.dataDialog.dataScopeType[i].permission_id = res[index].permission_id
|
||||
if (res[index].users) this.dataDialog.dataScopeType[i].users = res[index].users
|
||||
if (res[index].depts) this.dataDialog.dataScopeType[i].depts = res[index].depts
|
||||
// 选中
|
||||
@@ -719,24 +717,23 @@ export default {
|
||||
},
|
||||
openRelevance(row, index) {
|
||||
for (var i = 0; i < this.permissions.length; i++) {
|
||||
if (this.permissions[i].permissionId != undefined && this.permissions[i].permissionId && this.permissions[i].permissionId != row.permissionId) {
|
||||
this.$delete(this.dataDialog.dataScopeType[index], this.permissions[i].permissionId.toString())
|
||||
if (this.permissions[i].permission_id != undefined && this.permissions[i].permission_id && this.permissions[i].permission_id != row.permission_id) {
|
||||
this.$delete(this.dataDialog.dataScopeType[index], this.permissions[i].permission_id.toString())
|
||||
}
|
||||
}
|
||||
this.$set(this.dataDialog.dataScopeType[index], this.dataDialog.dataScopeType[index].permissionId, row.permissionId)
|
||||
this.$set(this.dataDialog.dataScopeType[index], this.dataDialog.dataScopeType[index].permission_id, row.permission_id)
|
||||
this.rowData = {}
|
||||
this.deptIds = []
|
||||
this.userIds = []
|
||||
console.log(row)
|
||||
if (row.permissionId == '1605129738328870912') { // 选择用户
|
||||
if (row.permission_id == '1605129738328870912') { // 选择用户
|
||||
this.userIds = this.dataDialog.dataScopeType[index].users
|
||||
this.rowData = row
|
||||
this.relevanceUser = true
|
||||
} else if (row.permissionId == '1605129882164137984') { // 选择部门
|
||||
} else if (row.permission_id == '1605129882164137984') { // 选择部门
|
||||
this.deptIds = this.dataDialog.dataScopeType[index].depts
|
||||
this.rowData = row
|
||||
this.relevanceDept = true
|
||||
} else if (row.permissionId == '1605128919449735168') { // 自身
|
||||
} else if (row.permission_id == '1605128919449735168') { // 自身
|
||||
const param = {
|
||||
userId: this.dataDialog.userId
|
||||
}
|
||||
@@ -749,7 +746,7 @@ export default {
|
||||
},
|
||||
selectUsers(row) { // row对话框传来的数据
|
||||
for (var i = 0; i < this.dataDialog.dataScopeType.length; i++) {
|
||||
if (this.dataDialog.dataScopeType[i].dictId == this.rowData.dictId) {
|
||||
if (this.dataDialog.dataScopeType[i].dict_id == this.rowData.dict_id) {
|
||||
if (this.dataDialog.dataScopeType[i].depts != undefined && this.dataDialog.dataScopeType[i].depts.length > 0) this.dataDialog.dataScopeType[i].depts = []
|
||||
this.dataDialog.dataScopeType[i].users = row
|
||||
break
|
||||
@@ -759,7 +756,7 @@ export default {
|
||||
},
|
||||
selectDepts(row) {
|
||||
for (var i = 0; i < this.dataDialog.dataScopeType.length; i++) {
|
||||
if (this.dataDialog.dataScopeType[i].dictId == this.rowData.dictId) {
|
||||
if (this.dataDialog.dataScopeType[i].dict_id == this.rowData.dictId) {
|
||||
if (this.dataDialog.dataScopeType[i].users != undefined && this.dataDialog.dataScopeType[i].users.length > 0) this.dataDialog.dataScopeType[i].users = []
|
||||
this.dataDialog.dataScopeType[i].depts = row
|
||||
break
|
||||
@@ -772,10 +769,9 @@ export default {
|
||||
},
|
||||
savePermise() {
|
||||
const param = {
|
||||
userId: this.dataDialog.userId,
|
||||
user_id: this.dataDialog.user_id,
|
||||
datas: this.multipleSelection
|
||||
}
|
||||
console.log('param', param)
|
||||
crudDataPermission.saveDataPermission(param).then(res => {
|
||||
this.dataPerm = false
|
||||
this.crud.notify('添加数据权限成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
@@ -788,7 +784,7 @@ export default {
|
||||
this.depChecked = []
|
||||
},
|
||||
giveValue(row) {
|
||||
this.depCheckedId = row.userId
|
||||
this.depCheckedId = row.user_id
|
||||
},
|
||||
clearCheck() { // 清空选中
|
||||
if (this.flag) this.$refs.deptUser.setCheckedKeys([])
|
||||
@@ -806,12 +802,12 @@ export default {
|
||||
},
|
||||
saveChecked() {
|
||||
const user = {
|
||||
userId: this.depCheckedId
|
||||
user_id: this.depCheckedId
|
||||
}
|
||||
if (this.flag) {
|
||||
user.deptIds = this.$refs.deptUser.getCheckedKeys()
|
||||
} else {
|
||||
user.rolesIds = this.crud.selections.map(item => (item.roleId))
|
||||
user.rolesIds = this.crud.selections.map(item => (item.role_id))
|
||||
}
|
||||
crudUser.edit(user).then(res => {
|
||||
this.cancelForm()
|
||||
|
||||
@@ -44,8 +44,16 @@
|
||||
<el-table-column prop="standing_time" label="静置时间(分钟)" :min-width="flexWidth('standing_time',crud.data,'静置时间(分钟)')"/>
|
||||
<el-table-column prop="workshop_code" label="车间编码" :min-width="flexWidth('workshop_code',crud.data,'车间编码')"/>
|
||||
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')"/>
|
||||
<el-table-column prop="is_used" label="是否启用" :min-width="flexWidth('is_used',crud.data,'是否启用')"/>
|
||||
<el-table-column prop="is_delete" label="是否删除" :min-width="flexWidth('is_delete',crud.data,'是否删除')"/>
|
||||
<el-table-column prop="is_used" label="是否启用" :min-width="flexWidth('is_used',crud.data,'是否启用')">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.is_used?'是':'否'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="is_delete" label="是否删除" :min-width="flexWidth('is_delete',crud.data,'是否删除')">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.is_delete?'是':'否'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')"/>
|
||||
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')"/>
|
||||
<el-table-column prop="update_name" label="修改人" :min-width="flexWidth('update_name',crud.data,'修改人')"/>
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
<el-input v-model="form.remark" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用">
|
||||
<el-input v-model="form.is_used" style="width: 370px;" />
|
||||
<el-radio v-model="form.is_used" :label=false>否</el-radio>
|
||||
<el-radio v-model="form.is_used" :label=true>是</el-radio>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@@ -31,8 +32,11 @@
|
||||
<el-table-column prop="workshop_code" label="车间编码" :min-width="flexWidth('workshop_code',crud.data,'车间编码')"/>
|
||||
<el-table-column prop="workshop_name" label="车间名称 " :min-width="flexWidth('workshop_name',crud.data,'车间名称 ')"/>
|
||||
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')"/>
|
||||
<el-table-column prop="is_used" label="是否启用" :min-width="flexWidth('is_used',crud.data,'是否启用')"/>
|
||||
<el-table-column prop="is_delete" label="是否删除" :min-width="flexWidth('is_delete',crud.data,'是否删除')"/>
|
||||
<el-table-column prop="is_used" label="是否启用" :min-width="flexWidth('is_used',crud.data,'是否启用')">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.is_used?'是':'否'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')"/>
|
||||
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')"/>
|
||||
<el-table-column prop="update_name" label="修改人" :min-width="flexWidth('update_name',crud.data,'修改人')"/>
|
||||
@@ -64,8 +68,8 @@ const defaultForm = {
|
||||
workshop_code: null,
|
||||
workshop_name: null,
|
||||
remark: null,
|
||||
is_used: null,
|
||||
is_delete: null,
|
||||
is_used: true,
|
||||
is_delete: false,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
|
||||
195
nladmin-ui/src/views/wms/pdm/workerorder/index.vue
Normal file
195
nladmin-ui/src/views/wms/pdm/workerorder/index.vue
Normal file
@@ -0,0 +1,195 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label">工单编号</label>
|
||||
<el-input v-model="query.workorder_code" clearable placeholder="工单编号" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<label class="el-form-item-label">点位编码</label>
|
||||
<el-input v-model="query.point_code" clearable placeholder="点位编码" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<rrOperation :crud="crud" />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="工单编号">
|
||||
<el-input v-model="form.workorder_code" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生产日期">
|
||||
<el-input v-model="form.produce_date" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划数量">
|
||||
<el-input v-model="form.plan_qty" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="实际数量">
|
||||
<el-input v-model="form.real_qty" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料标识">
|
||||
<el-input v-model="form.material_id" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="载具类型">
|
||||
<el-input v-model="form.vehicle_type" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划开始时间">
|
||||
<el-input v-model="form.planproducestart_date" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划结束时间">
|
||||
<el-input v-model="form.planproduceend_date" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="实际开始时间">
|
||||
<el-input v-model="form.realproducestart_date" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="实际结束时间">
|
||||
<el-input v-model="form.realproduceend_date" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="静置时间(分钟)">
|
||||
<el-input v-model="form.standing_time" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="点位编码">
|
||||
<el-input v-model="form.point_code" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="点位名称">
|
||||
<el-input v-model="form.point_name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="区域编码">
|
||||
<el-input v-model="form.region_code" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="区域名称">
|
||||
<el-input v-model="form.region_name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否需要AGV搬运">
|
||||
<el-input v-model="form.is_needmove" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工单类型">
|
||||
<el-input v-model="form.workorder_type" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车间编码">
|
||||
<el-input v-model="form.workshop_code" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</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>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="workorder_code" label="工单编号" :min-width="flexWidth('workorder_code',crud.data,'工单编号')"/>
|
||||
<el-table-column prop="produce_date" label="生产日期" :min-width="flexWidth('produce_date',crud.data,'生产日期')"/>
|
||||
<el-table-column prop="plan_qty" label="计划数量" :min-width="flexWidth('plan_qty',crud.data,'计划数量')"/>
|
||||
<el-table-column prop="real_qty" label="实际数量" :min-width="flexWidth('real_qty',crud.data,'实际数量')"/>
|
||||
<el-table-column prop="material_id" label="物料标识" :min-width="flexWidth('material_id',crud.data,'物料标识')"/>
|
||||
<el-table-column prop="vehicle_type" label="载具类型" :min-width="flexWidth('vehicle_type',crud.data,'载具类型')"/>
|
||||
<el-table-column prop="planproducestart_date" label="计划开始时间" :min-width="flexWidth('planproducestart_date',crud.data,'计划开始时间')"/>
|
||||
<el-table-column prop="planproduceend_date" label="计划结束时间" :min-width="flexWidth('planproduceend_date',crud.data,'计划结束时间')"/>
|
||||
<el-table-column prop="realproducestart_date" label="实际开始时间" :min-width="flexWidth('realproducestart_date',crud.data,'实际开始时间')"/>
|
||||
<el-table-column prop="realproduceend_date" label="实际结束时间" :min-width="flexWidth('realproduceend_date',crud.data,'实际结束时间')"/>
|
||||
<el-table-column prop="standing_time" label="静置时间(分钟)" :min-width="flexWidth('standing_time',crud.data,'静置时间(分钟)')"/>
|
||||
<el-table-column prop="point_code" label="点位编码" :min-width="flexWidth('point_code',crud.data,'点位编码')"/>
|
||||
<el-table-column prop="point_name" label="点位名称" :min-width="flexWidth('point_name',crud.data,'点位名称')"/>
|
||||
<el-table-column prop="region_code" label="区域编码" :min-width="flexWidth('region_code',crud.data,'区域编码')"/>
|
||||
<el-table-column prop="region_name" label="区域名称" :min-width="flexWidth('region_name',crud.data,'区域名称')"/>
|
||||
<el-table-column prop="workorder_status" label="工单状态" :min-width="flexWidth('workorder_status',crud.data,'工单状态')"/>
|
||||
<el-table-column prop="is_needmove" label="是否需要AGV搬运" :min-width="flexWidth('is_needmove',crud.data,'是否需要AGV搬运')"/>
|
||||
<el-table-column prop="workorder_type" label="工单类型" :min-width="flexWidth('workorder_type',crud.data,'工单类型')"/>
|
||||
<el-table-column prop="passback_status" label="回传MES状态" :min-width="flexWidth('passback_status',crud.data,'回传MES状态')"/>
|
||||
<el-table-column prop="workshop_code" label="车间编码" :min-width="flexWidth('workshop_code',crud.data,'车间编码')"/>
|
||||
<el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')"/>
|
||||
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')"/>
|
||||
<el-table-column prop="update_name" label="修改人" :min-width="flexWidth('update_name',crud.data,'修改人')"/>
|
||||
<el-table-column prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')"/>
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudPdmBdWorkorder from './pdmBdWorkorder'
|
||||
import CRUD, {crud, form, header, presenter} from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = {
|
||||
workorder_id: null,
|
||||
workorder_code: null,
|
||||
produce_date: null,
|
||||
plan_qty: null,
|
||||
real_qty: null,
|
||||
material_id: null,
|
||||
vehicle_type: null,
|
||||
planproducestart_date: null,
|
||||
planproduceend_date: null,
|
||||
realproducestart_date: null,
|
||||
realproduceend_date: null,
|
||||
standing_time: null,
|
||||
point_code: null,
|
||||
point_name: null,
|
||||
region_code: null,
|
||||
region_name: null,
|
||||
workorder_status: null,
|
||||
is_needmove: null,
|
||||
workorder_type: null,
|
||||
passback_status: null,
|
||||
workshop_code: null,
|
||||
ext_id: null,
|
||||
is_delete: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_id: null,
|
||||
update_name: null,
|
||||
update_time: null
|
||||
}
|
||||
export default {
|
||||
name: 'PdmBdWorkorder',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '工单管理',
|
||||
url: 'api/pdmBdWorkorder',
|
||||
idField: 'workorder_id',
|
||||
sort: 'workorder_id,desc',
|
||||
crudMethod: { ...crudPdmBdWorkorder }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
},
|
||||
queryTypeOptions: [
|
||||
{ key: 'workorder_code', display_name: '工单编号' },
|
||||
{ key: 'point_code', display_name: '点位编码' }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
27
nladmin-ui/src/views/wms/pdm/workerorder/pdmBdWorkorder.js
Normal file
27
nladmin-ui/src/views/wms/pdm/workerorder/pdmBdWorkorder.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/pdmBdWorkorder',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/pdmBdWorkorder/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/pdmBdWorkorder',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
Reference in New Issue
Block a user