常熟吴彦祖 11 hours ago
parent
commit
8498c87bfa
  1. 13
      src/api/haianWarehouse/cacheTransport.js
  2. 202
      src/views/modules/haianWarehouse/automatedWarehouse/cacheTransportTask54.vue
  3. 6
      src/views/modules/haianWarehouse/noOrderIssue/newNoOrderIssueNotify54.vue

13
src/api/haianWarehouse/cacheTransport.js

@ -0,0 +1,13 @@
import { createAPI } from '@/utils/httpRequest.js'
// 海安齐套运输:getCacheTransportAreas,POST实体必须显式传site,业务错误由页面展示。- rqrq
export const getCacheTransportAreas = data => createAPI('/haiAnCacheTransport/getCacheTransportAreas', 'post', data)
// 海安齐套运输:saveCacheTransportAreas,POST实体必须显式传site,业务错误由页面展示。- rqrq
export const saveCacheTransportAreas = data => createAPI('/haiAnCacheTransport/saveCacheTransportAreas', 'post', data)
// 海安齐套运输:getCacheTransportTaskPage,POST实体必须显式传site,业务错误由页面展示。- rqrq
export const getCacheTransportTaskPage = data => createAPI('/haiAnCacheTransport/getCacheTransportTaskPage', 'post', data)
// 海安齐套运输:getCacheTransportTaskDetails,POST实体必须显式传site,业务错误由页面展示。- rqrq
export const getCacheTransportTaskDetails = data => createAPI('/haiAnCacheTransport/getCacheTransportTaskDetails', 'post', data)

202
src/views/modules/haianWarehouse/automatedWarehouse/cacheTransportTask54.vue

@ -0,0 +1,202 @@
<template>
<div class="cache-transport">
<!-- 纯主从查询上表展示主单记录点击一行后下表展示该任务的托盘明细- rqrq -->
<el-form ref="queryForm" :inline="true" label-position="top" @submit.native.prevent>
<el-form-item label="工厂"><el-input :value="query.site" disabled style="width:80px" /></el-form-item>
<el-form-item v-for="field in searchFields" :key="field.key" :label="field.label">
<el-input v-model="query[field.key]" clearable style="width:150px" @keyup.enter.native="search" />
</el-form-item>
<el-form-item label="调度状态">
<el-select v-model="query.status" clearable style="width:120px">
<el-option v-for="s in statuses" :key="s" :label="s" :value="s" />
</el-select>
</el-form-item>
<el-form-item label="下单日期从"><el-date-picker v-model="query.startDate" type="date" value-format="yyyy-MM-dd" style="width:145px" /></el-form-item>
<el-form-item label="至"><el-date-picker v-model="query.endDate" type="date" value-format="yyyy-MM-dd" style="width:145px" /></el-form-item>
<el-form-item label=" ">
<el-button type="primary" :loading="queryLoading" :disabled="queryLoading" @click="search">查询</el-button>
<el-button :disabled="queryLoading" @click="reset">重置</el-button>
</el-form-item>
</el-form>
<el-table ref="taskTable" v-loading="queryLoading" :data="rows" border highlight-current-row :height="tableHeight" row-key="id" @current-change="openDetails">
<el-table-column prop="id" label="任务ID" width="85" />
<el-table-column prop="subSite" label="子工厂" width="90" />
<el-table-column prop="notifyNo" label="领料单号" width="150" show-overflow-tooltip />
<el-table-column prop="soorderNo" label="订单号" width="140" show-overflow-tooltip />
<el-table-column prop="orderPartNo" label="订单物料" width="150" show-overflow-tooltip />
<el-table-column prop="sourceAreaId" label="源缓存区" width="115" show-overflow-tooltip />
<!-- 优先显示同工厂目标区域名称未维护名称时回退编码避免历史任务显示空白- rqrq -->
<el-table-column prop="targetAreaName" label="目标区域" width="150" show-overflow-tooltip>
<template slot-scope="s">{{ s.row.targetAreaName || s.row.targetAreaId }}</template>
</el-table-column>
<el-table-column prop="status" label="调度状态" width="100" />
<el-table-column label="托盘数量" width="95" align="right">
<template slot-scope="s">{{ Number(s.row.palletCount) || 0 }}</template>
</el-table-column>
<!-- <el-table-column prop="createdName" label="下单人" width="115" show-overflow-tooltip />-->
<el-table-column prop="createdBy" label="下单账号" width="125" show-overflow-tooltip />
<el-table-column prop="createdTime" label="下单时间" width="165" />
<el-table-column prop="completedTime" label="调度完成时间" width="165" />
</el-table>
<el-pagination ref="pagination" :current-page="query.page" :page-size="query.limit" :total="total" :disabled="queryLoading" :page-sizes="[20, 50, 100]" layout="total, sizes, prev, pager, next" @current-change="changePage" @size-change="changeSize" />
<!-- 下表直接显示本任务的托盘记录不弹窗不展开标签不查询实时托盘位置- rqrq -->
<div ref="detailTitle" class="detail-title">托盘明细<span v-if="selected.id"> </span></div>
<el-table ref="detailTable" v-loading="detailLoading" :data="details" border :height="detailTableHeight" row-key="id" :empty-text="selected.id ? '暂无托盘明细' : '请先选择上表任务'">
<el-table-column prop="palletId" label="托盘号" width="120" fixed />
<el-table-column prop="status" label="调度状态" width="100" />
<el-table-column label="完成原因" width="145"><template slot-scope="s">{{ finishText(s.row.finishReason) }}</template></el-table-column>
<el-table-column label="运输状态" width="110"><template slot-scope="s">{{ s.row.executionStatus || '未下发' }}</template></el-table-column>
<el-table-column v-for="field in detailFields" :key="field.key" :prop="field.key" :label="field.label" :width="field.width || 160" :show-overflow-tooltip="!!field.tooltip" />
</el-table>
</div>
</template>
<script>
import { getCacheTransportTaskPage, getCacheTransportTaskDetails } from '@/api/haianWarehouse/cacheTransport'
// PC使- rqrq
export default {
data () {
return {
query: { site: '', page: 1, limit: 20, orderNo: '', notifyNo: '', soorderNo: '', createdBy: '', status: '', startDate: '', endDate: '' },
rows: [],
total: 0,
queryLoading: false,
detailLoading: false,
selected: {},
details: [],
// 使- rqrq
tableHeight: 100,
detailTableHeight: 100,
// - rqrq
detailRequestId: 0,
statuses: ['待调度', '处理中', '待核实', '已完成'],
searchFields: [{ key: 'orderNo', label: '运输单号' }, { key: 'notifyNo', label: '领料单号' }, { key: 'soorderNo', label: '订单号' }, { key: 'createdBy', label: '下单账号' }],
detailFields: [
{ key: 'sourceAreaId', label: '下单缓存区', width: 110 }, { key: 'sourceStation', label: '下单站点' },
{ key: 'actualSourceArea', label: '实际起始区', width: 110 }, { key: 'actualSourceStation', label: '实际起始站点' },
{ key: 'targetStation', label: '目标站点' }, { key: 'taskNo', label: 'WOT任务号', tooltip: true }, { key: 'actualTaskNo', label: '实际运输任务号', tooltip: true },
{ key: 'dispatchedTime', label: '下发时间', width: 170 }, { key: 'completedTime', label: '调度完成时间', width: 170 },
{ key: 'pickedTime', label: '取货时间', width: 170 }, { key: 'arrivedTime', label: '放货时间', width: 170 },
{ key: 'actualTargetArea', label: '实际送达区域', width: 115 },
{ key: 'errorMsg', label: '调度说明', width: 260, tooltip: true }, { key: 'executionError', label: '运输异常', width: 200, tooltip: true }
]
}
},
created () {
// site- rqrq
this.query.site = this.$store.state.user.site
this.load()
},
mounted () {
// - rqrq
window.addEventListener('resize', this.updateTableHeights)
if (window.ResizeObserver) {
this.queryResizeObserver = new window.ResizeObserver(this.updateTableHeights)
this.queryResizeObserver.observe(this.$refs.queryForm.$el)
this.queryResizeObserver.observe(this.$refs.pagination.$el)
}
this.updateTableHeights()
},
activated () {
// keep-alive- rqrq
this.updateTableHeights()
},
beforeDestroy () {
// 访- rqrq
window.removeEventListener('resize', this.updateTableHeights)
if (this.queryResizeObserver) this.queryResizeObserver.disconnect()
},
methods: {
// - rqrq
updateTableHeights () {
this.$nextTick(() => {
if (this._isDestroyed || !this.$el.offsetWidth || !this.$refs.taskTable) return
const outerHeight = element => {
const style = window.getComputedStyle(element)
return element.offsetHeight + (parseFloat(style.marginTop) || 0) + (parseFloat(style.marginBottom) || 0)
}
const availableHeight = window.innerHeight - this.$refs.taskTable.$el.getBoundingClientRect().top -
outerHeight(this.$refs.pagination.$el) - outerHeight(this.$refs.detailTitle) - 20
// - rqrq
const totalHeight = Math.max(200, Math.floor(availableHeight))
this.tableHeight = Math.floor(totalHeight / 2)
this.detailTableHeight = totalHeight - this.tableHeight
this.$nextTick(() => {
if (this._isDestroyed) return
if (this.$refs.taskTable) this.$refs.taskTable.doLayout()
if (this.$refs.detailTable) this.$refs.detailTable.doLayout()
})
})
},
finishText (reason) { return reason === 'DISPATCHED' ? 'WCS已受理' : reason === 'LEFT_CACHE' ? '已离开缓存区' : '—' },
search () { if (!this.queryLoading) { this.query.page = 1; this.load() } },
reset () {
if (this.queryLoading) return
this.searchFields.forEach(f => { this.query[f.key] = '' })
this.query.status = ''; this.query.startDate = ''; this.query.endDate = ''
this.search()
},
changePage (page) { if (!this.queryLoading) { this.query.page = page; this.load() } },
changeSize (limit) { if (!this.queryLoading) { this.query.limit = limit; this.search() } },
// finallysite- rqrq
async load () {
if (this.queryLoading) return
this.query.site = this.$store.state.user.site
this.queryLoading = true
// - rqrq
this.detailRequestId += 1
this.selected = {}; this.details = []; this.detailLoading = false
this.rows = []; this.total = 0
const site = this.query.site
try {
const { data } = await getCacheTransportTaskPage(Object.assign({}, this.query))
if (site !== this.$store.state.user.site) return
if (data && data.code === 0) {
this.rows = (data.page && data.page.list) || []
this.total = (data.page && data.page.totalCount) || 0
} else {
this.$alert((data && data.msg) || '查询齐套运输任务失败', '提示')
return
}
// - rqrq
await this.$nextTick()
if (this.$refs.taskTable) this.$refs.taskTable.setCurrentRow(null)
} catch (e) {
this.rows = []; this.total = 0
this.$message.error('查询齐套运输任务网络异常')
return
} finally {
this.queryLoading = false
}
// current-change- rqrq
if (site === this.$store.state.user.site && this.rows.length && this.$refs.taskTable) {
this.$refs.taskTable.setCurrentRow(this.rows[0])
}
},
// site+ID- rqrq
openDetails (row) {
const requestId = ++this.detailRequestId
this.selected = {}; this.details = []; this.detailLoading = false
if (!row || this.queryLoading) return
const site = this.$store.state.user.site
if (row.site !== site) { this.$alert('工厂已变化,请重新查询主表', '提示'); return }
this.selected = row; this.detailLoading = true
getCacheTransportTaskDetails({ site, id: row.id }).then(({ data }) => {
if (requestId !== this.detailRequestId || site !== this.$store.state.user.site) return
if (data && data.code === 0) this.details = data.rows || []
else this.$alert((data && data.msg) || '查询托盘明细失败', '提示')
}).catch(() => {
if (requestId === this.detailRequestId && site === this.$store.state.user.site) this.$message.error('查询托盘明细网络异常')
}).finally(() => { if (requestId === this.detailRequestId) this.detailLoading = false })
}
}
}
</script>
<style scoped>
/* 表格高度随当前窗口分配,分页和标题间距参与可用高度计算。- rqrq */
.cache-transport .el-pagination { margin-top: 14px; text-align: right; }
.cache-transport .detail-title { margin: 16px 0 10px; font-size: 14px; font-weight: bold; }
</style>

6
src/views/modules/haianWarehouse/noOrderIssue/newNoOrderIssueNotify54.vue

@ -94,16 +94,16 @@
</el-table> </el-table>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<el-dialog title="新增工单物料" :close-on-click-modal="false" v-drag :visible.sync="seqNoModalFlag" width="980px">
<el-dialog title="新增物料" :close-on-click-modal="false" v-drag :visible.sync="seqNoModalFlag" width="980px">
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="10"> <el-col :span="10">
<el-form-item label="订单类型">
<el-form-item label="领料单用途">
<el-radio-group v-model="orderType" :disabled="seqNoList.length>0" size="small"> <el-radio-group v-model="orderType" :disabled="seqNoList.length>0" size="small">
<el-radio label="slittingorder">分切订单</el-radio> <el-radio label="slittingorder">分切订单</el-radio>
<el-radio label="shipment">销售发货</el-radio> <el-radio label="shipment">销售发货</el-radio>
<el-radio label="shoporder">成品订单</el-radio> <el-radio label="shoporder">成品订单</el-radio>
<el-radio label="baofei">报废</el-radio>
<el-radio label="baofei">报废</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>

Loading…
Cancel
Save