fix:合并代码
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/** 可配送工单 */
|
||||
export function getWorkOrders(params) {
|
||||
return request({
|
||||
url: '/api/platingDelivery/workOrders',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
/** 产线下拉 */
|
||||
export function getWorkAreas() {
|
||||
return request({
|
||||
url: '/api/platingDelivery/workAreas',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/** 所选工单BOM按上料口+物料汇总 */
|
||||
export function getBomSummary(workOrders) {
|
||||
return request({
|
||||
url: '/api/platingDelivery/bomSummary',
|
||||
method: 'get',
|
||||
params: { workOrders: workOrders.join(',') }
|
||||
})
|
||||
}
|
||||
|
||||
/** 库区列表 */
|
||||
export function getSects() {
|
||||
return request({
|
||||
url: '/api/platingDelivery/sects',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/** 库区配盘数据 */
|
||||
export function getPallets(params) {
|
||||
return request({
|
||||
url: '/api/platingDelivery/pallets',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
/** 批量配送出库 */
|
||||
export function deliver(data) {
|
||||
return request({
|
||||
url: '/api/platingDelivery/deliver',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { getWorkOrders, getWorkAreas, getBomSummary, getSects, getPallets, deliver }
|
||||
@@ -0,0 +1,533 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 工单与BOM汇总 -->
|
||||
<el-card shadow="never" class="box-card">
|
||||
<div slot="header" class="card-header">
|
||||
<span>1. 选择工单</span>
|
||||
<div>
|
||||
<el-button type="primary" size="mini" icon="el-icon-plus" @click="openOrderDialog">选择工单</el-button>
|
||||
<el-button size="mini" icon="el-icon-delete" :disabled="!selectedOrders.length" @click="clearOrders">清空</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="order-tags">
|
||||
<template v-if="selectedOrders.length">
|
||||
<el-tag v-for="order in selectedOrders" :key="order.order_code" size="small" closable @close="removeOrder(order)">
|
||||
{{ order.order_code }}
|
||||
</el-tag>
|
||||
<span class="summary">共 {{ selectedOrders.length }} 张工单 · {{ bomRows.length }} 条物料需求</span>
|
||||
</template>
|
||||
<span v-else class="placeholder">请点击「选择工单」选取需要配送的工单(可多选)</span>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
v-loading="bomLoading"
|
||||
:data="bomRows"
|
||||
size="mini"
|
||||
border
|
||||
max-height="260"
|
||||
style="margin-top: 10px;"
|
||||
empty-text="请选择工单后查看汇总"
|
||||
>
|
||||
<el-table-column prop="load_port" label="上料口" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="material_code" label="物料编码" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="material_name" label="物料名称" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="unit" label="单位" width="80" />
|
||||
<el-table-column label="需求数量" width="110" align="right">
|
||||
<template slot-scope="{ row }">{{ formatQty(row.need_qty) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="已领数量" width="110" align="right">
|
||||
<template slot-scope="{ row }">{{ formatQty(row.used_qty) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="剩余需求" width="110" align="right">
|
||||
<template slot-scope="{ row }">
|
||||
<span :class="{ 'danger-text': Number(row.remain_qty) <= 0 }">{{ formatQty(row.remain_qty) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="涉及工单" min-width="200">
|
||||
<template slot-scope="{ row }">{{ (row.orders || []).join('、') }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<!-- 库区与配盘数据 -->
|
||||
<el-card shadow="never" class="box-card">
|
||||
<div slot="header" class="card-header">
|
||||
<span>2. 选择库区与配盘数据</span>
|
||||
<div class="sect-selector">
|
||||
<span class="label">库区:</span>
|
||||
<el-select
|
||||
v-model="sectCode"
|
||||
size="mini"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择库区"
|
||||
style="width: 240px;"
|
||||
:disabled="!selectedOrders.length"
|
||||
@change="loadPallets"
|
||||
>
|
||||
<el-option
|
||||
v-for="sect in sects"
|
||||
:key="sect.sect_code"
|
||||
:label="sect.sect_name + '(' + sect.sect_code + ')'"
|
||||
:value="sect.sect_code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button size="mini" icon="el-icon-refresh" :disabled="!sectCode" @click="loadPallets">刷新</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-alert
|
||||
v-if="selectedOrders.length && !sectCode"
|
||||
title="请选择库区,系统将按工单关联的上料口查询该库区已入库的配盘数据"
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
/>
|
||||
<el-table
|
||||
ref="palletTable"
|
||||
v-loading="palletLoading"
|
||||
:data="pallets"
|
||||
size="mini"
|
||||
border
|
||||
max-height="420"
|
||||
style="margin-top: 10px;"
|
||||
empty-text="该库区暂无可配送的配盘数据"
|
||||
@selection-change="handlePalletSelection"
|
||||
>
|
||||
<el-table-column type="selection" width="50" :selectable="rowSelectable" />
|
||||
<el-table-column prop="pallet_code" label="托盘码" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="struct_code" label="库位" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="load_port" label="上料口" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="item_count" label="物料行数" width="90" align="center" />
|
||||
<el-table-column label="托盘数量" width="110" align="right">
|
||||
<template slot-scope="{ row }">{{ formatQty(row.total_qty) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sect_name" label="库区" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="状态" width="90" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<el-tag v-if="row.conflict" type="danger" size="mini">数据异常</el-tag>
|
||||
<el-tag v-else type="success" size="mini">已入库</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column type="expand" label="物料明细" width="90">
|
||||
<template slot-scope="{ row }">
|
||||
<el-table :data="row.materials" size="mini" border>
|
||||
<el-table-column prop="material_code" label="物料编码" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="material_name" label="物料名称" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="pcsn" label="批次" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column label="数量" width="100" align="right">
|
||||
<template slot-scope="{ row: item }">{{ formatQty(item.qty) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unit" label="单位" width="80" />
|
||||
</el-table>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="footer-bar">
|
||||
<span class="summary">已选 {{ selectedPallets.length }} 个托盘 · 合计数量 {{ formatQty(selectedQty) }}</span>
|
||||
<el-button type="primary" size="mini" icon="el-icon-s-promotion" :loading="submitting" @click="submit">
|
||||
出库配送
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 工单选择弹窗 -->
|
||||
<el-dialog
|
||||
title="选择工单"
|
||||
:visible.sync="orderDialogVisible"
|
||||
width="1000px"
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
@open="openOrderDialogHandle"
|
||||
>
|
||||
<el-form :inline="true" size="mini" label-suffix=":" @submit.native.prevent>
|
||||
<el-form-item label="工单号/产品">
|
||||
<el-input
|
||||
v-model="orderQuery.keyword"
|
||||
clearable
|
||||
placeholder="请输入工单号或产品名称"
|
||||
style="width: 200px;"
|
||||
@keyup.enter.native="searchOrders"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="产线">
|
||||
<el-select
|
||||
v-model="orderQuery.workArea"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择产线"
|
||||
style="width: 160px;"
|
||||
@change="searchOrders"
|
||||
>
|
||||
<el-option v-for="area in workAreas" :key="area" :label="area" :value="area" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码">
|
||||
<el-input
|
||||
v-model="orderQuery.materialCode"
|
||||
clearable
|
||||
placeholder="请输入物料编码"
|
||||
style="width: 180px;"
|
||||
@keyup.enter.native="searchOrders"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="mini" icon="el-icon-search" @click="searchOrders">查询</el-button>
|
||||
<el-button size="mini" icon="el-icon-refresh" @click="resetOrderQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
ref="orderTable"
|
||||
v-loading="orderLoading"
|
||||
:data="orderRows"
|
||||
size="mini"
|
||||
border
|
||||
max-height="420"
|
||||
row-key="order_code"
|
||||
@selection-change="handleOrderSelection"
|
||||
>
|
||||
<el-table-column type="selection" width="50" reserve-selection />
|
||||
<el-table-column prop="order_code" label="工单号" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="work_area" label="产线" min-width="110" show-overflow-tooltip />
|
||||
<el-table-column prop="product_code" label="产品编码" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="product_name" label="产品名称" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="order_qty" label="计划数量" width="100" align="right" />
|
||||
<el-table-column prop="plan_started_on" label="计划开工" width="120" />
|
||||
<el-table-column label="状态" width="90" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<el-tag size="mini" :type="row.status === 2 ? 'success' : 'warning'">
|
||||
{{ row.status === 2 ? '执行中' : '待执行' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
background
|
||||
style="margin-top: 10px; text-align: right;"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:current-page.sync="orderPage.page"
|
||||
:page-size.sync="orderPage.size"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:total="orderPage.total"
|
||||
@current-change="queryOrders"
|
||||
@size-change="searchOrders"
|
||||
/>
|
||||
<span slot="footer">
|
||||
<span class="summary">已选 {{ tempSelection.length }} 张</span>
|
||||
<el-button size="mini" @click="orderDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" size="mini" @click="confirmOrders">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 配送结果 -->
|
||||
<el-dialog title="配送任务已生成" :visible.sync="resultVisible" width="760px" append-to-body>
|
||||
<el-alert
|
||||
:title="'出库单:' + (result.bill_code || '-') + ',已生成 ' + (result.task_count || 0) + ' 个AGV配送任务'"
|
||||
type="success"
|
||||
:closable="false"
|
||||
show-icon
|
||||
/>
|
||||
<el-table :data="result.tasks || []" size="mini" border style="margin-top: 10px;">
|
||||
<el-table-column prop="pallet_code" label="托盘码" min-width="140" />
|
||||
<el-table-column prop="task_code" label="任务号" min-width="160" />
|
||||
<el-table-column prop="struct_code" label="起点库位" min-width="120" />
|
||||
<el-table-column prop="end_point_code" label="终点工位" min-width="120" />
|
||||
</el-table>
|
||||
<span slot="footer">
|
||||
<el-button type="primary" size="mini" @click="resultVisible = false">关 闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getWorkOrders, getWorkAreas, getBomSummary, getSects, getPallets, deliver } from './delivery'
|
||||
|
||||
export default {
|
||||
name: 'PlatingDeliveryOutbound',
|
||||
data() {
|
||||
return {
|
||||
sects: [],
|
||||
// 工单
|
||||
selectedOrders: [],
|
||||
orderDialogVisible: false,
|
||||
orderLoading: false,
|
||||
orderQuery: {
|
||||
keyword: '',
|
||||
workArea: '',
|
||||
materialCode: ''
|
||||
},
|
||||
workAreas: [],
|
||||
orderPage: {
|
||||
page: 1,
|
||||
size: 20,
|
||||
total: 0
|
||||
},
|
||||
orderRows: [],
|
||||
tempSelection: [],
|
||||
// BOM
|
||||
bomRows: [],
|
||||
bomLoading: false,
|
||||
// 库区与配盘
|
||||
sectCode: '',
|
||||
pallets: [],
|
||||
palletLoading: false,
|
||||
selectedPallets: [],
|
||||
// 提交
|
||||
submitting: false,
|
||||
resultVisible: false,
|
||||
result: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
selectedQty() {
|
||||
return this.selectedPallets.reduce((sum, item) => sum + Number(item.total_qty || 0), 0)
|
||||
},
|
||||
loadPorts() {
|
||||
return [...new Set(this.bomRows.map(row => row.load_port).filter(Boolean))]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadSects()
|
||||
this.loadWorkAreas()
|
||||
},
|
||||
methods: {
|
||||
loadWorkAreas() {
|
||||
getWorkAreas().then(res => {
|
||||
this.workAreas = res.data || []
|
||||
}).catch(() => {})
|
||||
},
|
||||
formatQty(value) {
|
||||
if (value === null || value === undefined || value === '') return '0'
|
||||
const num = Number(value)
|
||||
if (isNaN(num)) return value
|
||||
return num.toLocaleString('zh-CN', { maximumFractionDigits: 4 })
|
||||
},
|
||||
loadSects() {
|
||||
getSects().then(res => {
|
||||
this.sects = res.data || []
|
||||
}).catch(() => {})
|
||||
},
|
||||
openOrderDialog() {
|
||||
this.orderDialogVisible = true
|
||||
},
|
||||
openOrderDialogHandle() {
|
||||
this.tempSelection = [...this.selectedOrders]
|
||||
this.queryOrders()
|
||||
},
|
||||
searchOrders() {
|
||||
this.orderPage.page = 1
|
||||
this.queryOrders()
|
||||
},
|
||||
resetOrderQuery() {
|
||||
this.orderQuery = { keyword: '', workArea: '', materialCode: '' }
|
||||
this.searchOrders()
|
||||
},
|
||||
queryOrders() {
|
||||
this.orderLoading = true
|
||||
getWorkOrders({
|
||||
keyword: this.orderQuery.keyword,
|
||||
workArea: this.orderQuery.workArea,
|
||||
materialCode: this.orderQuery.materialCode,
|
||||
page: this.orderPage.page,
|
||||
size: this.orderPage.size
|
||||
}).then(res => {
|
||||
const payload = res.data || {}
|
||||
this.orderRows = payload.records || []
|
||||
this.orderPage.total = Number(payload.total || 0)
|
||||
// 回显已选工单(跨页勾选由 reserve-selection 保留)
|
||||
this.$nextTick(() => {
|
||||
if (!this.$refs.orderTable) return
|
||||
const codes = this.tempSelection.map(o => o.order_code)
|
||||
this.orderRows.forEach(row => {
|
||||
if (codes.includes(row.order_code)) {
|
||||
this.$refs.orderTable.toggleRowSelection(row, true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
this.orderRows = []
|
||||
this.orderPage.total = 0
|
||||
}).finally(() => {
|
||||
this.orderLoading = false
|
||||
})
|
||||
},
|
||||
handleOrderSelection(rows) {
|
||||
this.tempSelection = rows
|
||||
},
|
||||
confirmOrders() {
|
||||
if (!this.tempSelection.length) {
|
||||
this.$message.warning('请至少选择一张工单')
|
||||
return
|
||||
}
|
||||
this.selectedOrders = [...this.tempSelection]
|
||||
this.orderDialogVisible = false
|
||||
// 工单变化后清空配盘选择,重新按新上料口筛选
|
||||
this.pallets = []
|
||||
this.selectedPallets = []
|
||||
this.loadBom()
|
||||
},
|
||||
removeOrder(order) {
|
||||
this.selectedOrders = this.selectedOrders.filter(o => o.order_code !== order.order_code)
|
||||
this.tempSelection = this.tempSelection.filter(o => o.order_code !== order.order_code)
|
||||
// 同步取消弹窗表格勾选,避免下次打开回显已移除的工单
|
||||
if (this.$refs.orderTable) {
|
||||
const selectedRow = (this.$refs.orderTable.selection || [])
|
||||
.find(r => r.order_code === order.order_code)
|
||||
if (selectedRow) {
|
||||
this.$refs.orderTable.toggleRowSelection(selectedRow, false)
|
||||
}
|
||||
}
|
||||
this.pallets = []
|
||||
this.selectedPallets = []
|
||||
this.loadBom()
|
||||
},
|
||||
clearOrders() {
|
||||
this.selectedOrders = []
|
||||
this.tempSelection = []
|
||||
this.orderPage.page = 1
|
||||
this.orderPage.total = 0
|
||||
if (this.$refs.orderTable) {
|
||||
this.$refs.orderTable.clearSelection()
|
||||
}
|
||||
this.bomRows = []
|
||||
this.pallets = []
|
||||
this.selectedPallets = []
|
||||
this.sectCode = ''
|
||||
},
|
||||
loadBom() {
|
||||
if (!this.selectedOrders.length) {
|
||||
this.bomRows = []
|
||||
return
|
||||
}
|
||||
this.bomLoading = true
|
||||
getBomSummary(this.selectedOrders.map(o => o.order_code)).then(res => {
|
||||
this.bomRows = res.data || []
|
||||
// 已选库区时按新上料口刷新配盘数据
|
||||
if (this.sectCode) {
|
||||
this.loadPallets()
|
||||
}
|
||||
}).catch(() => {
|
||||
this.bomRows = []
|
||||
}).finally(() => {
|
||||
this.bomLoading = false
|
||||
})
|
||||
},
|
||||
loadPallets() {
|
||||
if (!this.sectCode) {
|
||||
this.pallets = []
|
||||
this.selectedPallets = []
|
||||
return
|
||||
}
|
||||
this.palletLoading = true
|
||||
getPallets({
|
||||
sectCode: this.sectCode,
|
||||
loadPorts: this.loadPorts.join(',')
|
||||
}).then(res => {
|
||||
this.pallets = res.data || []
|
||||
this.selectedPallets = []
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.palletTable) {
|
||||
this.$refs.palletTable.clearSelection()
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.pallets = []
|
||||
}).finally(() => {
|
||||
this.palletLoading = false
|
||||
})
|
||||
},
|
||||
rowSelectable(row) {
|
||||
return !row.conflict
|
||||
},
|
||||
handlePalletSelection(rows) {
|
||||
this.selectedPallets = rows
|
||||
},
|
||||
submit() {
|
||||
if (!this.selectedOrders.length) {
|
||||
this.$message.warning('请先选择工单')
|
||||
return
|
||||
}
|
||||
if (!this.sectCode) {
|
||||
this.$message.warning('请先选择库区')
|
||||
return
|
||||
}
|
||||
if (!this.selectedPallets.length) {
|
||||
this.$message.warning('请勾选需要配送的配盘数据')
|
||||
return
|
||||
}
|
||||
const palletCodes = this.selectedPallets.map(p => p.pallet_code)
|
||||
this.$confirm(
|
||||
`确认对 ${palletCodes.length} 个托盘执行配送出库?系统将生成出库单并逐托下发AGV配送任务。`,
|
||||
'提示',
|
||||
{ type: 'warning' }
|
||||
).then(() => {
|
||||
this.submitting = true
|
||||
return deliver({
|
||||
workOrders: this.selectedOrders.map(o => o.order_code),
|
||||
sectCode: this.sectCode,
|
||||
pallets: palletCodes,
|
||||
pointType: '1'
|
||||
})
|
||||
}).then(res => {
|
||||
this.result = res.data || {}
|
||||
this.resultVisible = true
|
||||
this.$message.success('配送任务已生成')
|
||||
this.loadPallets()
|
||||
}).catch(() => {}).finally(() => {
|
||||
this.submitting = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.box-card {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-weight: 600;
|
||||
}
|
||||
.order-tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
min-height: 28px;
|
||||
}
|
||||
.placeholder {
|
||||
color: #999;
|
||||
font-size: 13px;
|
||||
}
|
||||
.summary {
|
||||
margin-left: 8px;
|
||||
color: #606266;
|
||||
font-size: 12px;
|
||||
}
|
||||
.sect-selector {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-weight: normal;
|
||||
}
|
||||
.sect-selector .label {
|
||||
font-size: 13px;
|
||||
color: #606266;
|
||||
}
|
||||
.footer-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 12px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
.danger-text {
|
||||
color: #f56c6c;
|
||||
font-weight: 600;
|
||||
}
|
||||
</style>
|
||||
@@ -46,7 +46,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statuses: [{ value: 0, label: '创建' }, { value: 1, label: '配盘中' }, { value: 2, label: '完成' }],
|
||||
statuses: [{ value: 0, label: '创建' }, { value: 1, label: '配盘中' }, { value: 3, label: '配盘完成' }, { value: 2, label: '完成' }],
|
||||
detailVisible: false,
|
||||
current: { items: [] }
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<!-- 操作按钮区域 -->
|
||||
<div style="margin-bottom: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;">
|
||||
<crudOperation :permission="permission" />
|
||||
<el-button type="success" size="mini" icon="el-icon-s-promotion" :disabled="!multipleSelection.length" @click="openDemandPreview">下发需求单</el-button>
|
||||
<!-- <el-button type="success" size="mini" icon="el-icon-s-promotion" :disabled="!multipleSelection.length" @click="pushOutbound">下推出库</el-button>-->
|
||||
</div>
|
||||
|
||||
<!-- 新增/编辑对话框 -->
|
||||
@@ -342,6 +342,15 @@ export default {
|
||||
}).finally(() => {
|
||||
this.demandIssuing = false
|
||||
})
|
||||
},
|
||||
pushOutbound() {
|
||||
const codes = this.multipleSelection.map(item => item.order_code)
|
||||
this.$confirm(`确认将 ${codes.length} 张工单下推出库?`, '提示', { type: 'warning' }).then(() => {
|
||||
return crudWorkOrder.pushOutbound(codes)
|
||||
}).then(() => {
|
||||
this.$message.success('工单出库单已生成')
|
||||
this.crud.refresh()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,4 +38,7 @@ export function previewDemand(ids) {
|
||||
export function issueDemand(ids) {
|
||||
return request({ url: 'api/platingDemand/issue', method: 'post', data: ids })
|
||||
}
|
||||
export default { add, edit, del, getItem, previewDemand, issueDemand }
|
||||
export function pushOutbound(ids) {
|
||||
return request({ url: 'api/workOrder/pushOutbound', method: 'post', data: ids })
|
||||
}
|
||||
export default { add, edit, del, getItem, previewDemand, issueDemand, pushOutbound }
|
||||
|
||||
46
nladmin-ui/src/views/wms/sch/emptyCall/emptyCall.js
Normal file
46
nladmin-ui/src/views/wms/sch/emptyCall/emptyCall.js
Normal file
@@ -0,0 +1,46 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/** 库区下拉(附在库空载具数量) */
|
||||
export function getSects() {
|
||||
return request({
|
||||
url: '/api/emptyVehicleCall/sects',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/** 库区在库空载具 */
|
||||
export function getPallets(params) {
|
||||
return request({
|
||||
url: '/api/emptyVehicleCall/pallets',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
/** 目标区域下拉 */
|
||||
export function getRegions() {
|
||||
return request({
|
||||
url: '/api/emptyVehicleCall/regions',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/** 目标区域点位及状态 */
|
||||
export function getPoints(params) {
|
||||
return request({
|
||||
url: '/api/emptyVehicleCall/points',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
/** 呼叫空托盘:生成AGV搬运任务 */
|
||||
export function callVehicles(data) {
|
||||
return request({
|
||||
url: '/api/emptyVehicleCall/call',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { getSects, getPallets, getRegions, getPoints, callVehicles }
|
||||
584
nladmin-ui/src/views/wms/sch/emptyCall/index.vue
Normal file
584
nladmin-ui/src/views/wms/sch/emptyCall/index.vue
Normal file
@@ -0,0 +1,584 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 1. 库区与在库空载具 -->
|
||||
<el-card shadow="never" class="box-card">
|
||||
<div slot="header" class="card-header">
|
||||
<span>1. 选择库区与空托盘</span>
|
||||
<div class="toolbar">
|
||||
<span class="label">库区:</span>
|
||||
<el-select
|
||||
v-model="sectCode"
|
||||
size="mini"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择库区"
|
||||
style="width: 280px;"
|
||||
@change="handleSectChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="sect in sects"
|
||||
:key="sect.sect_code"
|
||||
:label="sectLabel(sect)"
|
||||
:value="sect.sect_code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button size="mini" icon="el-icon-refresh" :disabled="!sectCode" @click="loadPallets">刷新</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-alert
|
||||
v-if="!sectCode"
|
||||
title="请选择库区,系统将列出该库区在库的空载具(库位有托且无在库物料)"
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
/>
|
||||
<template v-else>
|
||||
<div class="sub-bar">
|
||||
<span class="summary">共 {{ filteredPallets.length }} 个在库空载具</span>
|
||||
<el-input
|
||||
v-model="palletKeyword"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="搜索载具码/库位/上料口"
|
||||
style="width: 220px;"
|
||||
prefix-icon="el-icon-search"
|
||||
/>
|
||||
</div>
|
||||
<el-table
|
||||
ref="palletTable"
|
||||
v-loading="palletLoading"
|
||||
:data="filteredPallets"
|
||||
size="mini"
|
||||
border
|
||||
max-height="360"
|
||||
empty-text="该库区暂无在库空载具"
|
||||
@selection-change="handlePalletSelection"
|
||||
>
|
||||
<el-table-column type="selection" width="50" :selectable="palletSelectable" />
|
||||
<el-table-column prop="vehicle_code" label="载具码" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="vehicle_type" label="载具类型" width="110" show-overflow-tooltip />
|
||||
<el-table-column prop="struct_code" label="所在库位" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="上料口" min-width="160" show-overflow-tooltip>
|
||||
<template slot-scope="{ row }">
|
||||
<span v-if="row.load_port">{{ row.load_port_name }}({{ row.load_port }})</span>
|
||||
<span v-else class="placeholder">未绑定</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sect_name" label="库区" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="状态" width="100" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<el-tag v-if="row.selectable" type="success" size="mini">{{ row.state_text }}</el-tag>
|
||||
<el-tag v-else type="warning" size="mini">{{ row.state_text }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
</el-card>
|
||||
|
||||
<!-- 2. 目标区域与空闲点位 -->
|
||||
<el-card shadow="never" class="box-card">
|
||||
<div slot="header" class="card-header">
|
||||
<span>2. 选择目标区域与空闲点位</span>
|
||||
<div class="toolbar">
|
||||
<span class="label">目标区域:</span>
|
||||
<el-select
|
||||
v-model="regionCode"
|
||||
size="mini"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择目标区域"
|
||||
style="width: 260px;"
|
||||
@change="handleRegionChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="region in regions"
|
||||
:key="region.region_code"
|
||||
:label="region.region_name + '(' + region.region_code + ')'"
|
||||
:value="region.region_code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button size="mini" icon="el-icon-refresh" :disabled="!regionCode" @click="loadPoints">刷新</el-button>
|
||||
<el-button size="mini" :disabled="!regionCode" @click="autoFillPoints">按空托数自动补选</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-alert
|
||||
v-if="!regionCode"
|
||||
title="请选择目标区域,绿色为空位、灰色为已有托盘、橙色为任务占用,仅空位可勾选"
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
/>
|
||||
<template v-else>
|
||||
<div class="legend">
|
||||
<span class="legend-item"><i class="dot idle" />空位 {{ countByState('idle') }}</span>
|
||||
<span class="legend-item"><i class="dot used" />已有托盘 {{ countByState('used') }}</span>
|
||||
<span class="legend-item"><i class="dot busy" />任务占用 {{ countByState('busy') }}</span>
|
||||
<span class="summary">已选点位 {{ selectedPoints.length }} 个</span>
|
||||
</div>
|
||||
<div v-loading="pointLoading" class="point-grid">
|
||||
<div
|
||||
v-for="point in points"
|
||||
:key="point.point_code"
|
||||
class="point-chip"
|
||||
:class="[point.state, { selected: isPointSelected(point.point_code), disabled: !point.selectable }]"
|
||||
@click="togglePoint(point)"
|
||||
>
|
||||
<div class="point-name">{{ point.point_code }}</div>
|
||||
<div class="point-code">{{ point.point_name }}</div>
|
||||
<div v-if="point.vehicle_code" class="point-extra">托盘 {{ point.vehicle_code }}</div>
|
||||
<div class="point-state">{{ point.state_text }}</div>
|
||||
</div>
|
||||
<div v-if="!points.length && !pointLoading" class="placeholder empty">该区域暂无已启用点位</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-card>
|
||||
|
||||
<!-- 汇总与提交 -->
|
||||
<el-card shadow="never" class="box-card footer-card">
|
||||
<div class="footer-bar">
|
||||
<div class="footer-summary">
|
||||
<span>已选空托盘 <b>{{ selectedPallets.length }}</b> 个</span>
|
||||
<span>已选空闲点位 <b>{{ selectedPoints.length }}</b> 个</span>
|
||||
<span v-if="countGap > 0" class="danger-text">还差 {{ countGap }} 个空闲点位</span>
|
||||
<span v-else-if="selectedPallets.length" class="ok-text">数量校验通过,将按勾选顺序一一分配点位</span>
|
||||
</div>
|
||||
<div>
|
||||
<el-button size="mini" :disabled="!selectedPallets.length && !selectedPoints.length" @click="clearSelection">
|
||||
清空选择
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
icon="el-icon-s-promotion"
|
||||
:loading="submitting"
|
||||
:disabled="!canSubmit"
|
||||
@click="submit"
|
||||
>
|
||||
生成搬运任务
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 结果 -->
|
||||
<el-dialog title="搬运任务已生成" :visible.sync="resultVisible" width="820px" append-to-body>
|
||||
<el-alert
|
||||
:title="'已生成 ' + (result.task_count || 0) + ' 个空载具出库任务(' + (result.sect_name || '-') + ' → ' + (result.region_name || '-') + '),任务将由调度定时下发AGV'"
|
||||
type="success"
|
||||
:closable="false"
|
||||
show-icon
|
||||
/>
|
||||
<el-table :data="result.tasks || []" size="mini" border style="margin-top: 10px;">
|
||||
<el-table-column prop="vehicle_code" label="载具码" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="task_code" label="任务号" min-width="170" show-overflow-tooltip />
|
||||
<el-table-column prop="struct_code" label="起点库位" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="load_port" label="上料口" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="目标点位" min-width="150" show-overflow-tooltip>
|
||||
<template slot-scope="{ row }">{{ row.point_name }}({{ row.point_code }})</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span slot="footer">
|
||||
<el-button type="primary" size="mini" @click="resultVisible = false">关 闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getSects, getPallets, getRegions, getPoints, callVehicles } from './emptyCall'
|
||||
|
||||
export default {
|
||||
name: 'EmptyVehicleCall',
|
||||
data() {
|
||||
return {
|
||||
// 库区与空载具
|
||||
sects: [],
|
||||
sectCode: '',
|
||||
pallets: [],
|
||||
palletLoading: false,
|
||||
palletKeyword: '',
|
||||
selectedPallets: [],
|
||||
// 目标区域与点位
|
||||
regions: [],
|
||||
regionCode: '',
|
||||
points: [],
|
||||
pointLoading: false,
|
||||
selectedPoints: [],
|
||||
// 提交
|
||||
submitting: false,
|
||||
resultVisible: false,
|
||||
result: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
filteredPallets() {
|
||||
const keyword = (this.palletKeyword || '').trim().toLowerCase()
|
||||
if (!keyword) {
|
||||
return this.pallets
|
||||
}
|
||||
return this.pallets.filter(row => [row.vehicle_code, row.struct_code, row.load_port, row.load_port_name]
|
||||
.filter(Boolean)
|
||||
.some(value => String(value).toLowerCase().includes(keyword)))
|
||||
},
|
||||
countGap() {
|
||||
return Math.max(this.selectedPallets.length - this.selectedPoints.length, 0)
|
||||
},
|
||||
canSubmit() {
|
||||
return !!this.sectCode && !!this.regionCode &&
|
||||
this.selectedPallets.length > 0 &&
|
||||
this.selectedPoints.length >= this.selectedPallets.length &&
|
||||
!this.submitting
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 关键字过滤后表格重新渲染,清空勾选避免与不可见行不一致
|
||||
palletKeyword() {
|
||||
this.selectedPallets = []
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.palletTable) {
|
||||
this.$refs.palletTable.clearSelection()
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadSects()
|
||||
this.loadRegions()
|
||||
},
|
||||
methods: {
|
||||
sectLabel(sect) {
|
||||
const empty = Number(sect.empty_qty || 0)
|
||||
return `${sect.sect_name}(${sect.sect_code})· 空托 ${empty}`
|
||||
},
|
||||
loadSects() {
|
||||
getSects().then(res => {
|
||||
this.sects = res.data || []
|
||||
}).catch(() => {})
|
||||
},
|
||||
loadRegions() {
|
||||
getRegions().then(res => {
|
||||
this.regions = res.data || []
|
||||
}).catch(() => {})
|
||||
},
|
||||
handleSectChange() {
|
||||
this.pallets = []
|
||||
this.selectedPallets = []
|
||||
this.palletKeyword = ''
|
||||
if (!this.sectCode) {
|
||||
return
|
||||
}
|
||||
this.loadPallets()
|
||||
},
|
||||
handleRegionChange() {
|
||||
this.points = []
|
||||
this.selectedPoints = []
|
||||
if (!this.regionCode) {
|
||||
return
|
||||
}
|
||||
this.loadPoints()
|
||||
},
|
||||
loadPallets() {
|
||||
if (!this.sectCode) {
|
||||
this.pallets = []
|
||||
return
|
||||
}
|
||||
this.palletLoading = true
|
||||
getPallets({ sectCode: this.sectCode }).then(res => {
|
||||
this.pallets = res.data || []
|
||||
this.selectedPallets = []
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.palletTable) {
|
||||
this.$refs.palletTable.clearSelection()
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.pallets = []
|
||||
}).finally(() => {
|
||||
this.palletLoading = false
|
||||
})
|
||||
},
|
||||
loadPoints() {
|
||||
if (!this.regionCode) {
|
||||
this.points = []
|
||||
return
|
||||
}
|
||||
this.pointLoading = true
|
||||
getPoints({ regionCode: this.regionCode }).then(res => {
|
||||
this.points = res.data || []
|
||||
// 刷新后只保留仍可选的已勾选点位
|
||||
const idleCodes = this.points.filter(p => p.selectable).map(p => p.point_code)
|
||||
this.selectedPoints = this.selectedPoints.filter(code => idleCodes.includes(code))
|
||||
}).catch(() => {
|
||||
this.points = []
|
||||
}).finally(() => {
|
||||
this.pointLoading = false
|
||||
})
|
||||
},
|
||||
palletSelectable(row) {
|
||||
return !!row.selectable
|
||||
},
|
||||
handlePalletSelection(rows) {
|
||||
this.selectedPallets = rows
|
||||
},
|
||||
countByState(state) {
|
||||
return this.points.filter(p => p.state === state).length
|
||||
},
|
||||
isPointSelected(code) {
|
||||
return this.selectedPoints.includes(code)
|
||||
},
|
||||
togglePoint(point) {
|
||||
if (!point.selectable) {
|
||||
return
|
||||
}
|
||||
const index = this.selectedPoints.indexOf(point.point_code)
|
||||
if (index > -1) {
|
||||
this.selectedPoints.splice(index, 1)
|
||||
} else {
|
||||
this.selectedPoints.push(point.point_code)
|
||||
}
|
||||
},
|
||||
autoFillPoints() {
|
||||
const need = this.selectedPallets.length - this.selectedPoints.length
|
||||
if (need <= 0) {
|
||||
this.$message.info('空闲点位已满足当前空托数量')
|
||||
return
|
||||
}
|
||||
const candidates = this.points
|
||||
.filter(p => p.selectable && !this.isPointSelected(p.point_code))
|
||||
.slice(0, need)
|
||||
if (!candidates.length) {
|
||||
this.$message.warning('目标区域没有更多空闲点位')
|
||||
return
|
||||
}
|
||||
candidates.forEach(p => this.selectedPoints.push(p.point_code))
|
||||
if (candidates.length < need) {
|
||||
this.$message.warning(`目标区域空位不足,仅补选 ${candidates.length} 个`)
|
||||
}
|
||||
},
|
||||
clearSelection() {
|
||||
this.selectedPallets = []
|
||||
this.selectedPoints = []
|
||||
if (this.$refs.palletTable) {
|
||||
this.$refs.palletTable.clearSelection()
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
if (!this.sectCode) {
|
||||
this.$message.warning('请先选择库区')
|
||||
return
|
||||
}
|
||||
if (!this.selectedPallets.length) {
|
||||
this.$message.warning('请勾选需要出库的空托盘')
|
||||
return
|
||||
}
|
||||
if (!this.regionCode) {
|
||||
this.$message.warning('请选择目标区域')
|
||||
return
|
||||
}
|
||||
if (this.selectedPoints.length < this.selectedPallets.length) {
|
||||
this.$message.warning(`已选空托 ${this.selectedPallets.length} 个,空闲点位仅 ${this.selectedPoints.length} 个`)
|
||||
return
|
||||
}
|
||||
const vehicles = this.selectedPallets.map(p => p.vehicle_code)
|
||||
// 空托数少于空点位时,按勾选顺序取前 N 个点位
|
||||
const points = this.selectedPoints.slice(0, vehicles.length)
|
||||
this.$confirm(
|
||||
`确认将 ${vehicles.length} 个空托盘搬运到目标区域的 ${points.length} 个空闲点位?系统将生成空载具出库搬运任务。`,
|
||||
'提示',
|
||||
{ type: 'warning' }
|
||||
).then(() => {
|
||||
this.submitting = true
|
||||
return callVehicles({
|
||||
sectCode: this.sectCode,
|
||||
regionCode: this.regionCode,
|
||||
pallets: vehicles,
|
||||
points
|
||||
})
|
||||
}).then(res => {
|
||||
this.result = res.data || {}
|
||||
this.resultVisible = true
|
||||
this.$message.success('搬运任务已生成')
|
||||
this.clearSelection()
|
||||
this.loadPallets()
|
||||
this.loadPoints()
|
||||
this.loadSects()
|
||||
}).catch(() => {}).finally(() => {
|
||||
this.submitting = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.box-card {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.footer-card ::v-deep .el-card__body {
|
||||
padding: 10px 20px;
|
||||
}
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-weight: 600;
|
||||
}
|
||||
.toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-weight: normal;
|
||||
}
|
||||
.toolbar .label {
|
||||
font-size: 13px;
|
||||
color: #606266;
|
||||
}
|
||||
.sub-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.summary {
|
||||
color: #606266;
|
||||
font-size: 12px;
|
||||
}
|
||||
.placeholder {
|
||||
color: #999;
|
||||
font-size: 13px;
|
||||
}
|
||||
.placeholder.empty {
|
||||
padding: 20px 0;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
.legend {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
margin-bottom: 10px;
|
||||
font-size: 12px;
|
||||
color: #606266;
|
||||
}
|
||||
.legend-item {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
.dot {
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.dot.idle {
|
||||
background: #67c23a;
|
||||
}
|
||||
.dot.used {
|
||||
background: #c0c4cc;
|
||||
}
|
||||
.dot.busy {
|
||||
background: #e6a23c;
|
||||
}
|
||||
.point-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
|
||||
gap: 8px;
|
||||
max-height: 420px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.point-chip {
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
padding: 6px 8px;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
background: #fafafa;
|
||||
transition: all 0.15s;
|
||||
}
|
||||
.point-chip .point-name {
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.point-chip .point-code {
|
||||
color: #909399;
|
||||
font-size: 11px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.point-chip .point-extra {
|
||||
color: #606266;
|
||||
font-size: 11px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.point-chip .point-state {
|
||||
margin-top: 2px;
|
||||
font-size: 11px;
|
||||
color: #909399;
|
||||
}
|
||||
.point-chip.idle {
|
||||
border-color: #b3e19d;
|
||||
background: #f0f9eb;
|
||||
}
|
||||
.point-chip.idle .point-state {
|
||||
color: #67c23a;
|
||||
}
|
||||
.point-chip.used,
|
||||
.point-chip.busy {
|
||||
background: #f5f7fa;
|
||||
}
|
||||
.point-chip.used {
|
||||
border-color: #e4e7ed;
|
||||
}
|
||||
.point-chip.busy {
|
||||
border-color: #f5dab1;
|
||||
background: #fdf6ec;
|
||||
}
|
||||
.point-chip.busy .point-state {
|
||||
color: #e6a23c;
|
||||
}
|
||||
.point-chip.disabled {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.point-chip.selected {
|
||||
border-color: #409eff;
|
||||
box-shadow: 0 0 0 1px #409eff inset;
|
||||
background: #ecf5ff;
|
||||
}
|
||||
.point-chip.selected .point-state {
|
||||
color: #409eff;
|
||||
}
|
||||
.footer-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
}
|
||||
.footer-summary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
font-size: 13px;
|
||||
color: #606266;
|
||||
}
|
||||
.footer-summary b {
|
||||
color: #409eff;
|
||||
}
|
||||
.danger-text {
|
||||
color: #f56c6c;
|
||||
}
|
||||
.ok-text {
|
||||
color: #67c23a;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
@@ -110,14 +110,14 @@
|
||||
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="addFormDtl()"
|
||||
>
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="addFormDtl()"
|
||||
>
|
||||
添加单据
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -353,7 +353,7 @@ export default {
|
||||
this.flagnow = true
|
||||
}
|
||||
}
|
||||
if (!this.flagnow) {
|
||||
if (this.flagnow) {
|
||||
item.edit = true
|
||||
this.form.tableData.splice(-1, 0, item)
|
||||
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
|
||||
|
||||
@@ -96,6 +96,7 @@ import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudSectattr from '@/views/wms/basedata/sectattr/sectattr'
|
||||
import group, { getAllGroupInfo } from '@/views/wms/basedata/group/group.js'
|
||||
|
||||
export default {
|
||||
name: 'AddDtl',
|
||||
@@ -205,7 +206,10 @@ export default {
|
||||
return
|
||||
}
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', this.rows)
|
||||
group.getAllGroupInfo(this.rows).then(res => {
|
||||
this.rows = res.data || []
|
||||
this.$emit('tableChanged', this.rows)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,13 +160,19 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="出库区" prop="gender2">
|
||||
<el-cascader
|
||||
placeholder="请选择"
|
||||
:options="outBoundPoint"
|
||||
:props="{ checkStrictly: true }"
|
||||
<el-select
|
||||
v-model="form2.region_code"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="选择出库区"
|
||||
@change="outBoundChange"
|
||||
/>
|
||||
>
|
||||
<el-option
|
||||
v-for="item in outBoundRegion"
|
||||
:label="item.region_name"
|
||||
:value="item.region_code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -237,6 +243,7 @@ import checkoutbill from '@/views/wms/st/outbill/checkoutbill'
|
||||
import StructIvt from '@/views/wms/st/outbill/StructIvt'
|
||||
import PointDialog from '@/views/wms/sch/point/PointDialog'
|
||||
import crudPoint from '@/views/wms/sch/point/schBasePoint'
|
||||
import crudRegion from '@/views/wms/sch/region/schBaseRegion'
|
||||
import crudSectattr from '@/views/wms/basedata/sectattr/sectattr'
|
||||
|
||||
export default {
|
||||
@@ -322,9 +329,12 @@ export default {
|
||||
crudSectattr.getSectCode({ 'stor_code': this.storCode }).then(res => {
|
||||
this.sects = res.data
|
||||
})
|
||||
crudPoint.getRegionPoints({ 'regionCode': 'CKQ' }).then(res => {
|
||||
// crudPoint.getRegionPoints({ 'regionCode': 'CKQ' }).then(res => {
|
||||
// this.outBoundRegion = res.data
|
||||
// this.outBoundPoint = res.data
|
||||
// })
|
||||
crudRegion.getRegionList().then(res => {
|
||||
this.outBoundRegion = res.data
|
||||
this.outBoundPoint = res.data
|
||||
})
|
||||
},
|
||||
close() {
|
||||
@@ -368,18 +378,7 @@ export default {
|
||||
}
|
||||
},
|
||||
outBoundChange(val) {
|
||||
if (val.length === 1) {
|
||||
this.form2.region_code = ''
|
||||
this.form2.point_code = val[0]
|
||||
}
|
||||
if (val.length === 0) {
|
||||
this.form2.region_code = ''
|
||||
this.form2.point_code = ''
|
||||
}
|
||||
if (val.length === 2) {
|
||||
this.form2.region_code = val[0]
|
||||
this.form2.point_code = val[1]
|
||||
}
|
||||
this.form2.region_code = val
|
||||
},
|
||||
tabledisabled(row) {
|
||||
if ((row.work_status === '00' || row.work_status === '01') && row.is_issued === '0') {
|
||||
@@ -485,7 +484,7 @@ export default {
|
||||
}
|
||||
},
|
||||
allSetPointAllDtl() {
|
||||
if (this.form2.regon_code === '') {
|
||||
if (this.form2.region_code === '') {
|
||||
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user