3 changed files with 257 additions and 1 deletions
-
4src/api/haianWarehouse/palletOperationLog.js
-
247src/views/modules/haianWarehouse/automatedWarehouse/palletOperationLog54.vue
-
7src/views/modules/haianWarehouse/warehouse/wcsCallBackSearch54.vue
@ -0,0 +1,4 @@ |
|||
import { createAPI } from '@/utils/httpRequest.js' |
|||
|
|||
// 海安栈板操作记录:分页查询新表haian_pallet_operation_log,禁止串老pallet_operation_log - rqrq
|
|||
export const haiAnSearchPalletOperationLogList = data => createAPI('/autoWareHourceHaian/haiAnPalletOperationLog/list', 'post', data) |
|||
@ -0,0 +1,247 @@ |
|||
<template> |
|||
<div class="mod-config yzz"> |
|||
<!-- 查询区:site由登录工厂覆盖,只筛海安栈板操作日志 - rqrq --> |
|||
<el-form :inline="true" label-position="top" class="query-form"> |
|||
<el-form-item label="托盘号"> |
|||
<el-input v-model="queryData.searchPalletId" style="width: 150px" placeholder="请输入托盘号"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="操作类型"> |
|||
<el-select v-model="queryData.searchOperationType" style="width: 140px" clearable placeholder="请选择"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option label="调用托盘" value="调用托盘"></el-option> |
|||
<el-option label="调用标记" value="CALL"></el-option> |
|||
<el-option label="字段更新" value="UPDATE"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="操作者"> |
|||
<el-input v-model="queryData.searchOperator" style="width: 120px" placeholder="请输入操作者"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="任务号"> |
|||
<el-input v-model="queryData.searchTaskNo" style="width: 150px" placeholder="请输入任务号"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="开始时间"> |
|||
<el-date-picker v-model="queryData.startDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" style="width: 170px" placeholder="请选择开始时间"></el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="结束时间"> |
|||
<el-date-picker v-model="queryData.endDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" style="width: 170px" placeholder="请选择结束时间"></el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label=" "> |
|||
<el-button type="primary" :disabled="dataListLoading" @click="searchTable()">查询</el-button> |
|||
<el-button :disabled="dataListLoading" @click="resetQuery()">重置</el-button> |
|||
<!-- 导出当前筛选条件下的主表全部数据,分页位置保持不变 - rqrq --> |
|||
<download-excel |
|||
:fields="fields()" |
|||
:data="exportData" |
|||
type="xls" |
|||
:name="exportName" |
|||
:header="exportHeader" |
|||
:footer="exportFooter" |
|||
:fetch="createExportData" |
|||
:before-generate="startDownload" |
|||
:before-finish="finishDownload" |
|||
:disabled="exportLoading" |
|||
:class="{ 'is-disabled': exportLoading }" |
|||
:style="{ pointerEvents: exportLoading ? 'none' : 'auto' }" |
|||
:worksheet="$t('warehouse.common.exportWorksheet')" |
|||
class="el-button el-button--primary el-button--medium"> |
|||
{{ $t('warehouse.common.download') }} |
|||
</download-excel> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<el-table :height="height" :data="dataList" border highlight-current-row v-loading="dataListLoading" style="width: 100%;"> |
|||
<el-table-column prop="id" label="ID" min-width="60" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="palletId" label="托盘号" min-width="150" header-align="center" align="center" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="operationType" label="操作类型" min-width="100" header-align="center" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span :style="getOperationTypeStyle(scope.row.operationType)">{{ scope.row.operationType || '-' }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="operationReason" label="操作原因" min-width="200" header-align="center" align="left" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="fieldName" label="属性名" min-width="120" header-align="center" align="center" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="oldValue" label="旧值" min-width="100" header-align="center" align="center" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="newValue" label="新值" min-width="100" header-align="center" align="center" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="operator" label="操作者" min-width="100" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="operationTime" label="操作时间" min-width="160" header-align="center" align="center"> |
|||
<template slot-scope="scope">{{ formatDate(scope.row.operationTime) }}</template> |
|||
</el-table-column> |
|||
<el-table-column prop="taskNo" label="关联任务" min-width="150" header-align="center" align="center" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="remark" label="备注" min-width="150" header-align="center" align="center" show-overflow-tooltip></el-table-column> |
|||
</el-table> |
|||
|
|||
<el-pagination |
|||
@size-change="sizeChangeHandle" |
|||
@current-change="currentChangeHandle" |
|||
:current-page="pageIndex" |
|||
:page-sizes="[20, 50, 100, 1000]" |
|||
:page-size="pageSize" |
|||
:total="totalPage" |
|||
layout="total, sizes, prev, pager, next, jumper"> |
|||
</el-pagination> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { haiAnSearchPalletOperationLogList } from '@/api/haianWarehouse/palletOperationLog.js' |
|||
|
|||
export default { |
|||
name: 'palletOperationLog54', |
|||
data() { |
|||
return { |
|||
// 主表导出文件名、字段和防重复状态,按页面筛选条件拉取数据 - rqrq |
|||
exportData: [], |
|||
exportName: '海安栈板操作日志' + this.dayjs().format('YYYYMMDDHHmmss'), |
|||
exportHeader: ['海安栈板操作日志'], |
|||
exportFooter: [], |
|||
exportLoading: false, |
|||
|
|||
height: 500, |
|||
dataListLoading: false, |
|||
dataList: [], |
|||
queryData: { |
|||
site: this.$store.state.user.site, |
|||
searchPalletId: '', |
|||
searchOperationType: '', |
|||
searchOperator: '', |
|||
searchTaskNo: '', |
|||
startDate: '', |
|||
endDate: '' |
|||
}, |
|||
pageIndex: 1, |
|||
pageSize: 20, |
|||
totalPage: 0 |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.height = window.innerHeight - 220 |
|||
}) |
|||
this.getDataList() |
|||
}, |
|||
methods: { |
|||
// 按主表当前筛选条件请求全部数据;site显式传入,查询失败不生成旧数据文件 - rqrq |
|||
async createExportData () { |
|||
if (this.exportLoading) return [] |
|||
this.exportLoading = true |
|||
try { |
|||
const queryParams = { |
|||
...this.queryData, |
|||
site: this.$store.state.user.site, |
|||
page: 1, |
|||
limit: 999999 |
|||
} |
|||
// 复用主表列表接口,页码固定为1且容量覆盖当前筛选结果;失败时提示用户 - rqrq |
|||
const { data } = await haiAnSearchPalletOperationLogList(queryParams) |
|||
if (data && data.code === 0) { |
|||
return ((data.page && data.page.list) || []).map(item => ({ ...item, operationTime: this.formatDate(item.operationTime) })) |
|||
} |
|||
this.$alert((data && data.msg) || '导出失败', '错误') |
|||
return [] |
|||
} catch (error) { |
|||
this.$message.error('导出失败,请稍后重试') |
|||
return [] |
|||
} finally { |
|||
this.exportLoading = false |
|||
} |
|||
}, |
|||
// 下载组件钩子保留与标签操作记录页一致的调用方式 - rqrq |
|||
startDownload () {}, |
|||
finishDownload () {}, |
|||
// 导出字段与主表可见字段保持一致,字段来源于页面列配置 - rqrq |
|||
fields () { |
|||
return { |
|||
'ID': 'id', |
|||
'托盘号': 'palletId', |
|||
'操作类型': 'operationType', |
|||
'操作原因': 'operationReason', |
|||
'属性名': 'fieldName', |
|||
'旧值': 'oldValue', |
|||
'新值': 'newValue', |
|||
'操作者': 'operator', |
|||
'操作时间': 'operationTime', |
|||
'关联任务': 'taskNo', |
|||
'备注': 'remark' |
|||
} |
|||
}, |
|||
searchTable() { |
|||
this.pageIndex = 1 |
|||
this.getDataList() |
|||
}, |
|||
// 查询日志时统一覆盖site为当前登录工厂,避免人为清空导致跨厂查询 - rqrq |
|||
getDataList() { |
|||
this.dataListLoading = true |
|||
const params = { |
|||
...this.queryData, |
|||
site: this.$store.state.user.site, |
|||
page: this.pageIndex, |
|||
limit: this.pageSize |
|||
} |
|||
haiAnSearchPalletOperationLogList(params).then(({ data }) => { |
|||
if (data && data.code === 0) { |
|||
this.dataList = data.page.list || [] |
|||
this.pageIndex = data.page.currPage |
|||
this.totalPage = data.page.totalCount |
|||
} else { |
|||
this.dataList = [] |
|||
this.$alert(data.msg || '查询失败', '错误', { confirmButtonText: '确定' }) |
|||
} |
|||
}).catch(() => { |
|||
this.dataList = [] |
|||
this.$alert('查询失败,请稍后重试', '错误', { confirmButtonText: '确定' }) |
|||
}).finally(() => { |
|||
this.dataListLoading = false |
|||
}) |
|||
}, |
|||
resetQuery() { |
|||
this.queryData = { |
|||
site: this.$store.state.user.site, |
|||
searchPalletId: '', |
|||
searchOperationType: '', |
|||
searchOperator: '', |
|||
searchTaskNo: '', |
|||
startDate: '', |
|||
endDate: '' |
|||
} |
|||
this.searchTable() |
|||
}, |
|||
sizeChangeHandle(val) { |
|||
this.pageSize = val |
|||
this.pageIndex = 1 |
|||
this.getDataList() |
|||
}, |
|||
currentChangeHandle(val) { |
|||
this.pageIndex = val |
|||
this.getDataList() |
|||
}, |
|||
getOperationTypeStyle(type) { |
|||
const colorMap = { |
|||
'调用托盘': '#409EFF', |
|||
'CALL': '#409EFF', |
|||
'UPDATE': '#E6A23C' |
|||
} |
|||
return { |
|||
fontWeight: 'bold', |
|||
color: colorMap[type] || '#606266' |
|||
} |
|||
}, |
|||
formatDate(dateStr) { |
|||
if (!dateStr) return '' |
|||
const date = new Date(dateStr) |
|||
const year = date.getFullYear() |
|||
const month = String(date.getMonth() + 1).padStart(2, '0') |
|||
const day = String(date.getDate()).padStart(2, '0') |
|||
const hours = String(date.getHours()).padStart(2, '0') |
|||
const minutes = String(date.getMinutes()).padStart(2, '0') |
|||
const seconds = String(date.getSeconds()).padStart(2, '0') |
|||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}` |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.query-form { |
|||
margin-top: 1px; |
|||
margin-left: 0px; |
|||
} |
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue