3 changed files with 180 additions and 1 deletions
-
4src/api/transMove/transMoveRecord.js
-
2src/views/modules/haianWarehouse/automatedWarehouse/agvTask54.vue
-
175src/views/modules/transMove/transMoveRecordQuery.vue
@ -0,0 +1,4 @@ |
|||
import { createAPI } from '@/utils/httpRequest' |
|||
|
|||
// 显式传入请求工厂和分页条件,只查询栈板触发移库的_move三表。- rqrq
|
|||
export const searchTransMoveRecords = data => createAPI('/transMove/searchTransMoveRecords', 'post', data) |
|||
@ -0,0 +1,175 @@ |
|||
<template> |
|||
<div class="mod-config"> |
|||
<!-- 栈板移库独立查询:请求工厂来自当前选择,记录工厂列显示混托子工厂。- rqrq --> |
|||
<el-form :inline="true" label-position="top"> |
|||
<el-form-item label="工厂"> |
|||
<el-input v-model="query.site" disabled style="width: 90px" /> |
|||
</el-form-item> |
|||
<el-form-item label="移库单号"> |
|||
<el-input v-model="query.transNo" clearable style="width: 170px" @keyup.enter.native="handleSearch" /> |
|||
</el-form-item> |
|||
<el-form-item label="出入库类型"> |
|||
<el-select v-model="query.transTypeDb" clearable placeholder="全部" style="width: 140px"> |
|||
<el-option label="移库出库 STO" value="STO" /> |
|||
<el-option label="移库入库 STI" value="STI" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="标签号"> |
|||
<el-input v-model="query.subNo" clearable style="width: 160px" @keyup.enter.native="handleSearch" /> |
|||
</el-form-item> |
|||
<el-form-item label="物料编码"> |
|||
<el-input v-model="query.partNo" clearable style="width: 150px" @keyup.enter.native="handleSearch" /> |
|||
</el-form-item> |
|||
<el-form-item label="批次号"> |
|||
<el-input v-model="query.batchNo" clearable style="width: 140px" @keyup.enter.native="handleSearch" /> |
|||
</el-form-item> |
|||
<el-form-item label="事务库位"> |
|||
<el-input v-model="query.locationId" clearable style="width: 140px" @keyup.enter.native="handleSearch" /> |
|||
</el-form-item> |
|||
<el-form-item label="方向"> |
|||
<el-select v-model="query.direction" clearable placeholder="全部" style="width: 110px"> |
|||
<el-option label="出库 (-)" value="-" /> |
|||
<el-option label="入库 (+)" value="+" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="事务日期"> |
|||
<el-date-picker v-model="dateRange" type="daterange" value-format="yyyy-MM-dd" |
|||
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 270px" /> |
|||
</el-form-item> |
|||
<el-form-item label=" "> |
|||
<el-button type="primary" :loading="searchLoading" :disabled="searchLoading" @click="handleSearch">查询</el-button> |
|||
<el-button :disabled="searchLoading" @click="handleReset">重置</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<!-- 只展示_move的标签粒度行;事务库位取物料明细,数量按标签实际数量展示。- rqrq --> |
|||
<el-table v-loading="searchLoading" :data="dataList" border stripe :height="tableHeight"> |
|||
<el-table-column prop="site" label="记录工厂" width="100" /> |
|||
<el-table-column prop="transDate" label="事务日期" width="170" /> |
|||
<el-table-column prop="transNo" label="移库单号" width="180" /> |
|||
<el-table-column prop="orderRef1" label="关联移库单号" width="180" /> |
|||
<el-table-column prop="transTypeDb" label="类型" width="90" /> |
|||
<el-table-column prop="subNo" label="标签号" width="180" show-overflow-tooltip /> |
|||
<el-table-column prop="partNo" label="物料编码" width="160" show-overflow-tooltip /> |
|||
<el-table-column prop="batchNo" label="批次" width="140" show-overflow-tooltip /> |
|||
<el-table-column prop="warehouseId" label="仓库" width="100" /> |
|||
<el-table-column prop="locationId" label="事务库位" width="130" /> |
|||
<el-table-column label="标签数量" width="110" align="right"> |
|||
<template slot-scope="scope">{{ formatQty(scope.row.subQty) }}</template> |
|||
</el-table-column> |
|||
<el-table-column prop="direction" label="方向" width="70" /> |
|||
<el-table-column prop="wdrNo" label="WDR" width="130" show-overflow-tooltip /> |
|||
<el-table-column prop="engChgLevel" label="工程版本" width="100" /> |
|||
<el-table-column prop="userName" label="操作人" width="120" /> |
|||
<el-table-column prop="status" label="状态" width="130" /> |
|||
<el-table-column prop="headerRemark" label="备注" min-width="200" show-overflow-tooltip /> |
|||
</el-table> |
|||
<el-pagination :disabled="searchLoading" :current-page="pageIndex" :page-size="pageSize" |
|||
:page-sizes="[20, 50, 100, 200]" :total="totalCount" layout="total, sizes, prev, pager, next, jumper" |
|||
style="margin-top: 15px; text-align: right" @size-change="handleSizeChange" @current-change="handlePageChange" /> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { searchTransMoveRecords } from '@/api/transMove/transMoveRecord' |
|||
|
|||
export default { |
|||
name: 'TransMoveRecordQuery', |
|||
data () { |
|||
return { |
|||
query: { site: '', transNo: '', transTypeDb: '', subNo: '', partNo: '', batchNo: '', locationId: '', direction: '' }, |
|||
dateRange: [], |
|||
dataList: [], |
|||
searchLoading: false, |
|||
pageIndex: 1, |
|||
pageSize: 20, |
|||
totalCount: 0, |
|||
tableHeight: 500 |
|||
} |
|||
}, |
|||
created () { |
|||
// 先确定请求工厂再初始化查询,不从localStorage补业务site。- rqrq |
|||
this.query.site = this.$store.state.user.site |
|||
this.doSearch() |
|||
}, |
|||
mounted () { |
|||
// 固定当前视口表格高度并保留分页操作空间。- rqrq |
|||
this.tableHeight = Math.max(300, window.innerHeight - 350) |
|||
}, |
|||
methods: { |
|||
// 每次请求显式携带当前选择的工厂及分页条件,混托子工厂范围由后端映射。- rqrq |
|||
buildRequest () { |
|||
this.query.site = this.$store.state.user.site |
|||
const request = Object.assign({}, this.query, { site: this.$store.state.user.site, page: this.pageIndex, limit: this.pageSize }) |
|||
if (this.dateRange && this.dateRange.length === 2) { |
|||
request.startDate = this.dateRange[0] + ' 00:00:00' |
|||
request.endDate = this.dateRange[1] + ' 23:59:59' |
|||
} |
|||
return request |
|||
}, |
|||
// 输入筛选后从第一页查询,重复点击由请求中的loading拦截。- rqrq |
|||
handleSearch () { |
|||
if (this.searchLoading) return |
|||
this.pageIndex = 1 |
|||
this.doSearch() |
|||
}, |
|||
// 独立接口返回标准page;业务失败弹窗提示,网络失败提示错误,所有路径均复位loading。- rqrq |
|||
doSearch () { |
|||
if (this.searchLoading) return |
|||
const request = this.buildRequest() |
|||
if (!request.site) { |
|||
this.$alert('请先选择工厂', '提示', { type: 'warning' }) |
|||
return |
|||
} |
|||
this.searchLoading = true |
|||
searchTransMoveRecords(request).then(({ data }) => { |
|||
// 用户切换工厂后丢弃旧工厂响应,避免页面显示与当前业务工厂不一致。- rqrq |
|||
if (request.site !== this.$store.state.user.site) { |
|||
this.dataList = [] |
|||
this.totalCount = 0 |
|||
return |
|||
} |
|||
if (data && data.code === 0) { |
|||
const page = data.page || {} |
|||
this.dataList = page.list || [] |
|||
this.totalCount = page.totalCount || 0 |
|||
} else { |
|||
this.dataList = [] |
|||
this.totalCount = 0 |
|||
this.$alert((data && data.msg) || '查询栈板移库记录失败', '提示', { type: 'error' }) |
|||
} |
|||
}).catch(() => { |
|||
this.dataList = [] |
|||
this.totalCount = 0 |
|||
this.$message.error('栈板移库记录查询失败,请稍后重试') |
|||
}).finally(() => { |
|||
this.searchLoading = false |
|||
}) |
|||
}, |
|||
// 重置筛选后保留当前工厂并重新查询,查询期间按钮禁用。- rqrq |
|||
handleReset () { |
|||
if (this.searchLoading) return |
|||
this.query = { site: this.$store.state.user.site, transNo: '', transTypeDb: '', subNo: '', partNo: '', batchNo: '', locationId: '', direction: '' } |
|||
this.dateRange = [] |
|||
this.handleSearch() |
|||
}, |
|||
// 切换每页条数时重置页码,依旧显式传当前工厂。- rqrq |
|||
handleSizeChange (size) { |
|||
if (this.searchLoading) return |
|||
this.pageSize = size |
|||
this.pageIndex = 1 |
|||
this.doSearch() |
|||
}, |
|||
// 翻页保留筛选条件,加载期间不重复发起请求。- rqrq |
|||
handlePageChange (page) { |
|||
if (this.searchLoading) return |
|||
this.pageIndex = page |
|||
this.doSearch() |
|||
}, |
|||
// 空数量按0展示,数值转字符串去尾零,单位与标签库存单位一致。- rqrq |
|||
formatQty (qty) { |
|||
const value = Number(qty || 0) |
|||
return Number.isFinite(value) ? String(value) : '0' |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue