Commit 93a6e778 authored by 岑歆奕's avatar 岑歆奕 Committed by AiNoeLiYa

初步修改了出入库记录

Signed-off-by: 's avatarAiNoeLiYa <jzbcxy@gmail.com>
parent c4634bc9
...@@ -80,9 +80,8 @@ export function BaseTableArguments(selection, loading, processList, queryParams, ...@@ -80,9 +80,8 @@ export function BaseTableArguments(selection, loading, processList, queryParams,
this.processList = processList this.processList = processList
} }
// TODO: 组件表单所需的所有参数 // TODO: 组件表单所需的所有参数
export function BaseTableArgumentsTest(selection, loading, processList, queryParams, columnData) { export function BaseTableArgumentsTest(nIndex, selection, loading, processList, queryParams, columnData) {
// TODO: 选择框是否需要存在 (selection判断表单选择框是否需要存在) // TODO: 选择框是否需要存在 (selection判断表单选择框是否需要存在)
if (typeof selection !== 'boolean') { if (typeof selection !== 'boolean') {
console.warn('selection下拉框参数的type类型错误!请检查后重新赋值') console.warn('selection下拉框参数的type类型错误!请检查后重新赋值')
...@@ -109,8 +108,7 @@ export function BaseTableArgumentsTest(selection, loading, processList, queryPar ...@@ -109,8 +108,7 @@ export function BaseTableArgumentsTest(selection, loading, processList, queryPar
this.queryParams = queryParamsType this.queryParams = queryParamsType
} }
this.nIndex = nIndex
this.columnData = columnData this.columnData = columnData
this.processList = processList this.processList = processList
} }
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column type="index" label="序号" width="50" :index="allTableArguments.nIndex" />
<!-- TODO: 选择框是否开启,selectable控制是否单行禁用 --> <!-- TODO: 选择框是否开启,selectable控制是否单行禁用 -->
<el-table-column v-if="allTableArguments.columObj.selection" type="selection" :selectable="allTableArguments.columObj.selectable" width="50px" /> <el-table-column v-if="allTableArguments.columObj.selection" type="selection" :selectable="allTableArguments.columObj.selectable" width="50px" />
...@@ -77,6 +78,7 @@ ...@@ -77,6 +78,7 @@
<span v-if="column.status && row[column.prop]">{{ row[column.prop].msg }}</span> <span v-if="column.status && row[column.prop]">{{ row[column.prop].msg }}</span>
<!-- 自定义内容 --> <!-- 自定义内容 -->
<span v-if="column.ownDefined">{{ column.ownDefinedReturn(row,$index) }}</span> <span v-if="column.ownDefined">{{ column.ownDefinedReturn(row,$index) }}</span>
<!-- TODO: 时间数据 --> <!-- TODO: 时间数据 -->
<span v-if="column.time">{{ row[column.prop] | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span> <span v-if="column.time">{{ row[column.prop] | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
<!-- switch开关 --> <!-- switch开关 -->
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form v-show="showSearch" ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true" label-width="68px"> <el-form v-show="showSearch" ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true" label-width="68px">
<!-- <el-form-item label="登录地址" prop="ipaddr">-->
<!-- <el-input-->
<!-- v-model="queryParams.ipaddr"-->
<!-- placeholder="请输入登录地址"-->
<!-- clearable-->
<!-- :maxlength="30"-->
<!-- size="small"-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="设备名称" prop="userName"> <el-form-item label="设备名称" prop="userName">
<el-input <el-input
v-model="queryParams.username" v-model="queryParams.username"
...@@ -22,180 +13,77 @@ ...@@ -22,180 +13,77 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<!-- <el-form-item label="登录状态" prop="status">-->
<!-- <el-select--> <el-form-item label="Pn" prop="userName">
<!-- v-model="queryParams.status"--> <el-input
<!-- placeholder="请选择登录状态"--> v-model="queryParams.username"
<!-- clearable--> placeholder="Pn"
<!-- size="small"--> clearable
<!-- style="width: 240px"--> :maxlength="30"
<!-- >--> style="width: 240px;"
<!-- <el-option-->
<!-- v-for="dict in statusOptions"-->
<!-- :key="dict.dictValue"-->
<!-- :label="dict.dictLabel"-->
<!-- :value="dict.dictValue"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="登录时间">
<el-date-picker
v-model="queryParams.loginTime"
type="month"
size="small" size="small"
style="width: 170px" @keyup.enter.native="handleQuery"
value-format="yyyy-MM"
placeholder="请选择月份"
/> />
</el-form-item> --> </el-form-item>
<el-form-item label="编码" prop="userName">
<el-input
v-model="queryParams.username"
placeholder="请输入编码"
clearable
:maxlength="30"
style="width: 240px;"
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备名称" prop="userName">
<el-input
v-model="queryParams.username"
placeholder="请输入设备名称"
clearable
:maxlength="30"
style="width: 240px;"
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" size="small" icon="el-icon-search" @click="handleQuery">查询</el-button> <el-button type="primary" size="small" icon="el-icon-search" @click="handleQuery">查询</el-button>
</el-form-item> </el-form-item>
<div style="float: right"> <div style="float: right">
<el-form-item> <el-form-item>
<!-- v-hasPermi="['zt:loginlog:delete']"-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- size="small"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- >删除</el-button>-->
<!-- <coolbutton :type="deletetypePrimary" :name="deleteName" :size="deleteSize" :disabled="multiple" @btn-click="handleDelete" />-->
<!-- v-hasPermi="['zt:loginlog:clear']"-->
<!-- <el-button
type="danger"
size="small"
:icon="delIcon"
@click="handleClean"
>清空</el-button> -->
<!-- <coolbutton :type="cleantypePrimary" :name="cleanName" :haspermi="clearHaspermi" :icon="delIcon" :size="cleanSize" @btn-click="handleClean" />-->
<!-- v-hasPermi="['zt:loginlog:export']"-->
<el-button <el-button
type="success" type="success"
size="small" size="small"
icon="el-icon-download" icon="el-icon-download"
@click="handleExport" @click="handleExport"
>盘点</el-button> >盘点</el-button>
<!-- <coolbutton :type="exporttypePrimary" :name="exportName" :icon="exportIcon" :size="exportSize" @btn-click="handleExport" />-->
<!-- <el-button size="mini" @click="resetQuery">重置</el-button>--> <el-button
type="success"
size="small"
icon="el-icon-download"
@click="handleExport"
>导出</el-button>
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
<div class="placeholder" /> <div class="placeholder" />
<div style="padding:10px">
<div class="mb12 font-small-bold">log列表</div>
<!-- <el-table v-loading="loading" border :data="list" @selection-change="handleSelectionChange"> -->
<!-- <el-table-column type="selection" width="55" align="center" />-->
<!-- &lt;!&ndash; <el-table-column type="index" label="序号" width="50" />&ndash;&gt;-->
<!-- <el-table-column label="访问编号" width="100" align="center" prop="infoId" show-overflow-tooltip>-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.infoId || '-' }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="用户名称" align="center" prop="userName" show-overflow-tooltip>-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.userName || '-' }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="登录地址" align="center" prop="ipaddr" show-overflow-tooltip>-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.ipaddr || '-' }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="操作信息" align="center" prop="msg" show-overflow-tooltip>-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.msg || '-' }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- &lt;!&ndash; <el-table-column label="登录地址" align="center" prop="ipaddr" width="130" :show-overflow-tooltip="true" />&ndash;&gt;-->
<!-- <el-table-column label="登录地点" align="center" prop="loginLocation" :show-overflow-tooltip="true" />-->
<!-- &lt;!&ndash; <el-table-column label="浏览器" align="center" prop="browser" show-overflow-tooltip>&ndash;&gt;-->
<!-- &lt;!&ndash; <template slot-scope="scope">&ndash;&gt;-->
<!-- &lt;!&ndash; {{ scope.row.browser || '-' }}&ndash;&gt;-->
<!-- &lt;!&ndash; </template>&ndash;&gt;-->
<!-- &lt;!&ndash; </el-table-column>&ndash;&gt;-->
<!-- &lt;!&ndash; <el-table-column label="操作系统" align="center" prop="os" show-overflow-tooltip>&ndash;&gt;-->
<!-- &lt;!&ndash; <template slot-scope="scope">&ndash;&gt;-->
<!-- &lt;!&ndash; {{ scope.row.os || '-' }}&ndash;&gt;-->
<!-- &lt;!&ndash; </template>&ndash;&gt;-->
<!-- &lt;!&ndash; </el-table-column>&ndash;&gt;-->
<!-- <el-table-column label="登录状态" align="center" prop="status" :formatter="statusFormat" />-->
<!-- <el-table-column type="index" width="55" label="序号" align="center" />
<el-table-column label="访问编号" align="center" prop="businessId" />-->
<!-- <el-table-column label="设备名称" align="center" prop="username" />
<el-table-column label="XXXX" align="center" prop="ipaddr" width="130" :show-overflow-tooltip="true" />
<el-table-column label="XXXX" align="center" prop="loginLocation" :show-overflow-tooltip="true" /> -->
<!-- <el-table-column label="浏览器" align="center" prop="browser" />
<el-table-column label="操作系统" align="center" prop="os" />-->
<!-- <el-table-column label="登录状态" align="center" prop="status" :formatter="statusFormat" />-->
<!-- <el-table-column label="XXXX" align="center" prop="status">
<template slot-scope="scope">
<span v-if="scope.row.status === '0'">失败</span>
<span v-if="scope.row.status === '1'">成功</span>
</template>
</el-table-column>
<el-table-column label="提示信息" align="center">
<template slot-scope="scope">
{{ scope.row.msg || '-' }}
</template>
</el-table-column>
<el-table-column label="时间" align="center" prop="loginTime" width="180" show-overflow-tooltip>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.loginTime) | transformDateByFormat('YYYY-MM-DD HH:mm:ss') }}</span>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<coolbutton :type="textPrimary" :name="deleteName" :size="deleteSize" @btn-click="handleDelete(scope.row.businessId)" />
<el-button
type="text"
size="small"
@click="handleDelete(scope.row.businessId)"
>删除</el-button>
</template>
</el-table-column> -->
<!-- </el-table> -->
<el-table v-loading="loading" border :data="processList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column type="index" label="序号" width="80" />
<el-table-column label="工序名称" prop="processCode" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.remarks || '-' }}
</template>
</el-table-column>
<el-table-column label="编码" prop="lot">
<template slot-scope="scope">
{{ scope.row.createBy || '-' }}
</template>
</el-table-column>
<el-table-column label="位置" prop="location">
<template slot-scope="scope">
{{ scope.row.updateBy || '-' }}
</template>
</el-table-column>
<el-table-column label="位置" prop="location">
<template slot-scope="scope">
{{ scope.row.delFlag || '-' }}
</template>
</el-table-column>
<el-table-column label="厚度" prop="thickness">
<template slot-scope="scope">
{{ scope.row.flag|| '-' }}
</template>
</el-table-column>
<el-table-column label="创建人" prop="createBy">
<template slot-scope="scope">
{{ scope.row.businessId || '-' }}
</template>
</el-table-column>
<el-table-column label="创建时间" :show-overflow-tooltip="true" align="center" prop="createTime">
<template slot-scope="scope">
<span>{{ scope.row.ptype }}</span>
</template>
</el-table-column>
</el-table>
</div> <transition name="fade-transform" mode="out-in">
<component
:is="BaseTable"
:key="queryParams.pageNum"
:all-table-arguments="allTableArguments"
@handle-detail="handleDetail"
@handle-update="handleUpdate"
@handle-delete="handleDelete"
/>
</transition>
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
...@@ -203,6 +91,7 @@ ...@@ -203,6 +91,7 @@
:limit.sync="queryParams.rows" :limit.sync="queryParams.rows"
@pagination="getList" @pagination="getList"
/> />
<!-- 清空弹窗--> <!-- 清空弹窗-->
<el-dialog <el-dialog
title="选择清空月份" title="选择清空月份"
...@@ -259,11 +148,14 @@ ...@@ -259,11 +148,14 @@
</template> </template>
<script> <script>
import {cleanLogininfo, delLogininfo, exportLogininfo} from '@/api/monitor/loginInfo'
import {listLog} from '@/api/processLibrary/InventoryRecord' import {listLog} from '@/api/processLibrary/InventoryRecord'
import BaseTable from '@/components/Table/BaseTable/index.vue'
export default { export default {
name: 'LoginInfo', name: 'LoginInfo',
components: [
BaseTable
],
data() { data() {
return { return {
processList: [], processList: [],
...@@ -329,6 +221,140 @@ export default { ...@@ -329,6 +221,140 @@ export default {
username: undefined, username: undefined,
status: undefined, status: undefined,
loginTime: '' loginTime: ''
},
// TODO: 用来说明每一列的类型
columObj: {
// 选择框
selection: false,
// 选择框根据条件是否可选
selectable: (row, index) => {
if (row.switchs) {
return true
}
},
lazy: 'true',
// column列,columType(列类型,可选text(默认为普通文字模式),input(input可编辑框),switch(switch开关),image(图片),operation(操作按钮))
// prop(参数),label(列名),width(宽度),align(对齐方式),sortable(是否支持排序)
columnData: [{
ownDefined: true,
prop: 'ptype',
label: '库类型',
ownDefinedReturn: (row, $index) => {
switch (row.poperate) {
case '1':
return '设备库'
case '2':
return '工序库'
default:
return ''
}
}
},
{
ownDefined: true,
prop: 'poperate',
label: 'poperate',
width: '',
ownDefinedReturn: (row, $index) => {
switch (row.poperate) {
case '1':
return '入库'
case '2':
return '出库'
case '3':
return '修正'
case '4':
return '废弃'
default:
return ''
}
}
},
{
text: true,
prop: 'pn',
label: 'pn'
},
{
time: true,
prop: 'updateDate',
label: '操作时间',
align: 'center'
},
{
text: true,
prop: 'createBy',
label: '操作人',
sortable: false,
width: '210px'
},
// 如果为操作列,则需要填写需要的操作按钮,类型为Object。operation(操作类型,可选edit,delete,see),type(按钮样式,参考el—botton类型),label(按钮文字)icon(参考el-icon),color(字体颜色)
{
isOperation: true,
label: '操作',
width: '180px',
align: 'center',
sortable: false,
operation: [{
type: this.typeParent,
label: '详情',
icon: '',
color: '',
size: this.size,
buttonClick: this.handleDetail,
isShow: (row, $index) => {
return true
}
}, {
type: this.typeParent,
label: '修改',
icon: '',
color: '',
size: this.size,
buttonClick: this.handleUpdate,
isShow: (row, $index) => {
return true
}
}, {
type: this.typeParent,
label: '删除',
icon: '',
color: '',
size: this.size,
buttonClick: this.handleDelete,
isShow: (row, $index) => {
return true
}
}]
}
]
}
}
},
computed: {
BaseTable() {
return BaseTable
},
// TODO:自定义分页索引,实现索引继承
nIndex(index) {
// TODO: 当前页数 - 1 * 每页数据条数 + 1
const page = this.queryParams.pageNum // TODO: 当前页码
const pageSize = this.queryParams.pageSize // TODO: 每页条数
return index + 1 + (page - 1) * pageSize
},
// TODO: 用来汇总Table组件所需要的全部数据并一次性传输给子组件
allTableArguments() {
return {
listName: '出入库记录列表',
nIndex: this.nIndex,
loading: this.loading,
processList: this.processList,
queryParams: this.queryParams,
columObj: this.columObj
} }
} }
}, },
...@@ -350,11 +376,9 @@ export default { ...@@ -350,11 +376,9 @@ export default {
} }
// this.queryParams.loginTime = this.$parseDate(new Date(), 'YYYY-MM-DD HH:mm:ss') // this.queryParams.loginTime = this.$parseDate(new Date(), 'YYYY-MM-DD HH:mm:ss')
this.getList() this.getList()
// this.getDicts(dictCons['COMMON_STATUS']).then(response => {
// this.statusOptions = response.data
// })
}, },
methods: { methods: {
// 清空和导出弹出框的日期选择器禁用当前月份之后的月份 // 清空和导出弹出框的日期选择器禁用当前月份之后的月份
handelFixDate() { handelFixDate() {
return { return {
......
...@@ -390,15 +390,15 @@ export default { ...@@ -390,15 +390,15 @@ export default {
this.open = !this.open this.open = !this.open
}, },
// TODO: 获取所选行详情信息操作 // TODO: 获取所选行详情信息操作
handleDetail(row) { handleDetail(row, $index) {
this.singleDetails = this.formReset this.singleDetails = this.formReset
this.singleDetails = row this.singleDetails = row
this.title = '详情信息' this.title = '详情信息'
this.openDetails = !this.openDetails this.openDetails = !this.openDetails
}, },
/** TODO: 修改按钮操作 */ /** TODO: 修改按钮操作 */
handleUpdate(row) { handleUpdate(row, $index) {
this.reset() this.form = { ...this.formReset }
this.title = '修改工序' this.title = '修改工序'
const updProcessName = row.processName const updProcessName = row.processName
for (const pd of this.simulateProcessList) { for (const pd of this.simulateProcessList) {
...@@ -449,7 +449,7 @@ export default { ...@@ -449,7 +449,7 @@ export default {
return tip return tip
}, },
/** TODO:删除按钮操作 */ /** TODO:删除按钮操作 */
handleDelete(row) { handleDelete(row, $index) {
this.$confirm('是否确认操作?', '提示', { this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment